Operating System - Tru64 Unix
1819870 Members
2352 Online
109607 Solutions
New Discussion юеВ

Argument list too long....

 
SOLVED
Go to solution
aique
Frequent Advisor

Argument list too long....

Hi, i have a server running tru64 unix on it.
i am facing a problem. whenever i issue "ls" command with a '*' wildcard. After showing some 6-7 hundred files, it ends with an error message "Argument list too long".
Any suggestions to avoid this message would be highly arretiable.
Thanks and regards,

Abdul Qayyum.
10 REPLIES 10
Steven Schweda
Honored Contributor

Re: Argument list too long....

Patient: "Doctor, it hurts when I do this."
Doctor: "Don't do that."

Why "ls *" instead of "ls"?

The usual solution involves using "find", for
example:

find . -name '*'

The apostrophes in >'*'< prevent the shell
from expanding the wildcard >*<, which is
what causes the too-long argument list in a
command like "ls *".
Ivan Ferreira
Honored Contributor

Re: Argument list too long....

The number of files in your file system is too large. You should remove some files. You can use ls to list the files, if you want to run some command on those files, use find and xargs.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Hein van den Heuvel
Honored Contributor

Re: Argument list too long....

Steve is right.
There are easier commands for the shell.

But sometimes it is appropropriate to allow for even longer command lines. In that case, try reconfiguring the dynamic param exec_disable_arg_limit.
The default is 0.
Make it 1 to increase the limit.
Something like:

sysconfig -r proc exec_disable_arg_limit=1

Hein.
aique
Frequent Advisor

Re: Argument list too long....

Hi,
nice joke :)
well steven my client usually uses following commands frequently. And gets this error message:

#wc *.INT
ksh: /usr/bin/wc: arg list too long

#ls *.INT
ksh: /usr/bin/ls: arg list too long

And after showing some results it ends with the error message stated above.

Note: Its Tru64 Unix V5.1

Please suggest if i need to change some kernal parameter.

Thanks,
Abdul Qayyum.
Venkatesh BL
Honored Contributor

Re: Argument list too long....

Steven Schweda
Honored Contributor

Re: Argument list too long....

In directories with very many files, that
kind of wildcard use tends to cause this
problem.

I'll admit that "wc *.INT" does give you a
nice total at the end, which you won't get
with a "find" or "xargs" method.

I don't know where to find a directory with
too many files in it (and I'm too lazy to
make one), so I can't test this easily, but
it's possible that a different shell would
have a different limit. (I use "GNU bash,
version 3.1.1(1)-release (alpha-dec-osf5.1)",
for example, but I don't know if that's
actually better than your "ksh".)
Ivan Ferreira
Honored Contributor

Re: Argument list too long....

Try with something like:

ls |grep "INT"

la |grep "INT" | xargs -t -i wc {}
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Hein van den Heuvel
Honored Contributor
Solution

Re: Argument list too long....

> Please suggest if i need to change some kernal parameter.

Isn't that what I told you above already?

>>> sysconfig -r proc exec_disable_arg_limit=1

Hein.

aique
Frequent Advisor

Re: Argument list too long....

Hi,
Hein is changing the value of "exec_disable_arg_limit" to 1 is the only step to follow or any other parameter also needs to be changed like ARG_MAX?

Thanks,
Abdul Qayyum.
aique
Frequent Advisor

Re: Argument list too long....

My problem is solved by setting the value of exec_disable_arg_limit to 1.

Thanks to all.

Abdul Qayyum