O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

xargs

Synopsis

                  xargs [options] [command]

Execute command (with any initial arguments), but read remaining arguments from standard input instead of specifying them directly. xargs passes these arguments in several bundles to command, allowing command to process more arguments than it could normally handle at once. The arguments are typically a long list of filenames (generated by ls or find, for example) that get passed to xargs via a pipe.

Options

-0, --null

Expect filenames to be terminated by NULL instead of whitespace. Do not treat quotes or backslashes specially.

-e[string], --eof[= string]

Set EOF to _ or, if specified, to string.

--help

Print a summary of the options to xargs and then exit.

-i[string], --replace[= string]

Edit all occurrences of { }, or string, to the names read in on standard input. Unquoted blanks are not considered argument terminators. Implies -x and -l 1.

-l[lines], --max-lines[= lines]

Allow no more than lines nonblank input lines on the command line (default is 1). Implies -x.

-n args, --max-args= args

Allow no more than args arguments on the command line. May be overridden by -s.

-p, --interactive

Prompt for confirmation before running each command line. Implies -t.

-P max, --max-procs= max

Allow no more than max processes to run at once. The default is 1. A maximum of 0 allows as many as possible to run at once.

-r, --no-run-if-empty

Do not run command if standard input contains only blanks.

-s max, --max-chars= max

Allow no more than max characters ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required