- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: /bin/ls: Arg list too long
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:34 AM
тАО02-06-2001 03:34 AM
This will probably have passed on this list.
Sorry for the inconvenience of the overhead,
but I need to know what to do about it ???
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:45 AM
тАО02-06-2001 03:45 AM
Re: /bin/ls: Arg list too long
You get this error from shell.
I think You have many many files in this directory and You give pattern for ls.
use find
find . -name "pattern"
or
find . -name "pattern -exec ls {} \;
regards, Saa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:46 AM
тАО02-06-2001 03:46 AM
Re: /bin/ls: Arg list too long
that cannot be changed. .... How many files were you expecting back from the ls listing .... a large number I suspect ?
The shell generates this message when "exec()"
failes because the argument list exceeds available memory for arguments
and environment variables. The file /usr/include/sys/param.h defines
the variable NCARGS, which in turn defines the size for the argument
list. There is no way to change this value.... although the comments in
this file seem to indicate it is changeable, remember that all of the
Operating System has already been compiled based on the header file in
its current state. There are several Service Requests which have been
generated asking that the limit for NCARGS be increased, but until then,
you have two options:
1. Break your "ls" into smaller pieces - for example:
ls a*.gz
ls b*.gz
etc.
2. Try an alternate command. One example:
ls | grep .gz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:49 AM
тАО02-06-2001 03:49 AM
Re: /bin/ls: Arg list too long
I forget >
Try
getconf ARG_MAX
It show You the maximal size of argument.
regards Saa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 03:50 AM
тАО02-06-2001 03:50 AM
Re: /bin/ls: Arg list too long
There is a limit that I dont know by heart on arg values, that means you are certainly trying to list thousands of files..., you can use xargs as a workaround:
e.g.
ls ?xargs >outfile (Not worth trying to usr ? more since we are talking of large amount)
Do a man of xargs
Good luck
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 04:06 AM
тАО02-06-2001 04:06 AM
SolutionIf you are running HP-UX 10.20, there is a patch (PHKL_16751) that will add a new kernel parameter called "large_ncargs_enabled" which, if set to 1, will allow a much larger number of characters on the command line arguments (usually about 20K on 10.20).
Also, ARG_MAX found in /usr/include/limits.h indicates what this
limit is currently set at. Incidentally, this limit is much higher on 11.0 versus 10.20 (the patch on 10.20 will increase to the larger number that 11.0 allows - something like 200K).
I hope this helps.
Best regards.
Fred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 04:43 AM
тАО02-06-2001 04:43 AM
Re: /bin/ls: Arg list too long
It's a good idea to arrange files in separate directories. Also, ARG_MAX still has an upper limit, with the patch on 10.20 up from 20,400 bytes on a single line to more than 2 million characters per line. But this may still be too small. It's a good idea to become familiar with xargs to remove all limitations for processing a command line list.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2001 06:38 PM
тАО02-06-2001 06:38 PM
Re: /bin/ls: Arg list too long
sections ie if alpha characters do :-
ls a*
you will see all files starting with "a"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2001 07:34 AM
тАО02-07-2001 07:34 AM
Re: /bin/ls: Arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2001 01:44 PM
тАО02-27-2001 01:44 PM