How To Install Xargs?

How To Install Xargs?

xargs

Execute a command with piped arguments coming from another command, a file, etc.
The input is treated as a single block of text and split into separate arguments on spaces, tabs, newlines and end-of-file.

Maintainer: Andreas Metzler



Section: utils

Install xargs

  • Debian apt-get install findutils Click to copy
  • Ubuntu apt-get install findutils Click to copy
  • Alpine OS apk add findutils Click to copy
  • Arch Linux pacman -S findutils Click to copy
  • Kali Linux apt-get install findutils Click to copy
  • Fedora dnf install findutils-1 Click to copy
  • Raspbian apt-get install findutils Click to copy
  • macOS brew install findutils Click to copy

Execute a command with piped arguments coming from another command, a file, etc. The input is treated as a single block of text and split into separate arguments on spaces, tabs, newlines and end-of-file.

How to use xargs?

Below are few example commands for xargs that you can use in the terminal.

Main usage pattern:
arguments_source | xargs commandClick to copy
Delete all files with a `.backup` extension. `-print0` on find uses a null character to split the files, and `-0` changes the delimiter to the null character (useful if there's whitespace in filenames):
find . -name '*.backup' -print0 | xargs -0 rm -vClick to copy
Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:
arguments_source | xargs -I _ command _ optional_extra_argumentsClick to copy
To install the latest version of xargs in your favorite operating system just copy the xargs installation command from above and paste it into terminal. It will download and install the latest version of xargs 2026 package in your OS.