Technical article 127122

When running a command or script from a shell I get the error "arg list too long"

OpenServer 6.0.0UnixWare 7.1.4

Written · Last revised

Problem

When using a command with a wild card on a directory with a large number of files and/or sub-directories, I get the error "arg list too long."

Cause

ARG_MAX, by default, is configured to 32768.  The number of files
listed will depend on the utility being used, for example, "lf" will
'handle' more files than "rm".  Another dependancy will be the
number of characters in each filename passed as arguments.

Solution

Increase the current value of ARG_MAX to its limit.

For OpenServer 6 and UnixWare7 it is 1048576.

To check the current setting as root run:

# /etc/conf/bin/idtune -g ARG_MAX
To increase the value as root run
# /etc/conf/bin/idtune ARG_MAX 1048576
Rebuild the kernel with
# /etc/conf/bin/idbuild -B
and reboot.
NOTES:    The OpenServer5 equivalent for this command is detailed at:

TA105076, "table_grow - exec data table page limit of 25 pages (MAXEXECARGS) exceeded."

From the Xinuos technical article database, record 127122. Reproduced with permission. The original is at www.sco.com/ta/127122, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.