Skip to main content
1 of 2
tripleee
  • 8k
  • 2
  • 37
  • 45

There is no way to pass an argument between executables if it is larger than the kernel's ARG_MAX limit.

If you have a list of arguments which is too long, splitting it up into smaller pieces can be done e.g. with xargs. This runs the command as many times as necessary, supplying as many arguments as will fit. As a demo,

xargs -n 4 </etc/motd

will print the first four tokens on one line (first invocation), the next four through another, etc. (The -n argument sets a maximum number of arguments, so this doesn't use the ARG_MAX limit at all.)

tripleee
  • 8k
  • 2
  • 37
  • 45