find: Limiting Command Size
1
1 3.3.2.4 Limiting Command Size
1 .............................
1
1 'xargs' gives you control over how many arguments it passes to the
1 command each time it executes it. By default, it uses up to 'ARG_MAX' -
1 2k, or 128k, whichever is smaller, characters per command. It uses as
1 many lines and arguments as fit within that limit. The following
1 options modify those values.
1
1 '--no-run-if-empty'
1 '-r'
1 If the standard input does not contain any nonblanks, do not run
1 the command. By default, the command is run once even if there is
1 no input. This option is a GNU extension.
1
1 '--max-lines[=MAX-LINES]'
1 '-L MAX-LINES'
1 '-l[MAX-LINES]'
1 Use at most MAX-LINES nonblank input lines per command line;
1 MAX-LINES defaults to 1 if omitted; omitting the argument is not
1 allowed in the case of the '-L' option. Trailing blanks cause an
1 input line to be logically continued on the next input line, for
1 the purpose of counting the lines. Implies '-x'. The preferred
1 name for this option is '-L' as this is specified by POSIX.
1
1 '--max-args=MAX-ARGS'
1 '-n MAX-ARGS'
1 Use at most MAX-ARGS arguments per command line. Fewer than
1 MAX-ARGS arguments will be used if the size (see the '-s' option)
1 is exceeded, unless the '-x' option is given, in which case 'xargs'
1 will exit.
1
1 '--max-chars=MAX-CHARS'
1 '-s MAX-CHARS'
1 Use at most MAX-CHARS characters per command line, including the
1 command initial arguments and the terminating nulls at the ends of
1 the argument strings. If you specify a value for this option which
1 is too large or small, a warning message is printed and the
1 appropriate upper or lower limit is used instead. You can use
1 '--show-limits' option to understand the command-line limits
1 applying to 'xargs' and how this is affected by any other options.
1 The POSIX limits shown when you do this have already been adjusted
1 to take into account the size of your environment variables.
1
1 The largest allowed value is system-dependent, and is calculated as
1 the argument length limit for exec, less the size of your
1 environment, less 2048 bytes of headroom. If this value is more
1 than 128KiB, 128Kib is used as the default value; otherwise, the
1 default value is the maximum.
1