Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
XARGS(1) BSD General Commands Manual XARGS(1)
NAME
xargs -- construct argument list(s) and execute utility
SYNOPSIS
xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr] [-L number] [-n number [-x]]
[-P maxprocs] [-s size] [utility [argument ...]]
-J replstr
If this option is specified, xargs will use the data read from standard input to replace
the first occurrence of replstr instead of appending that data after all other arguments.
This option will not affect how many arguments will be read from input (-n), or the size
of the command(s) xargs will generate (-s). The option just moves where those arguments
will be placed in the command(s) that are executed. The replstr must show up as a dis-
tinct argument to xargs. It will not be recognized if, for instance, it is in the middle
of a quoted string. Furthermore, only the first occurrence of the replstr will be
replaced. For example, the following command will copy the list of files and directories
which start with an uppercase letter in the current directory to destdir:
/bin/ls -1d [A-Z]* | xargs -J % cp -rp % destdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.