- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unable to list file
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
Forums
Discussions
Discussions
Discussions
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
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
11-08-2006 05:46 PM
11-08-2006 05:46 PM
bash: /bin/ls: Argument list too long
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 05:56 PM
11-08-2006 05:56 PM
Re: Unable to list file
Well you might try a different shell.
ls has a limit to the number of files it can display. Period.
Reorganize the files.
ls a*
ls b*
go for shorter lists.
# this will run VERY slowly.
ls -1 > list
vi list
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 06:06 PM
11-08-2006 06:06 PM
Re: Unable to list file
" ls has limit " , is it possible to increase the limit ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 06:12 PM
11-08-2006 06:12 PM
Re: Unable to list file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 06:29 PM
11-08-2006 06:29 PM
Solutionthe message 'arglist too long' tells not only a limitation in shells but a limit an exec() call can handle.
Changing to another shell to get a successful
ls -d *
wont help.
Rearanging the directory structure (yes, we have something like directories to put files into!) will also lead to a performace benefit when accessing files.
MfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 06:53 PM
11-08-2006 06:53 PM
Re: Unable to list file
ls | grep "^a"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 06:56 PM
11-08-2006 06:56 PM
Re: Unable to list file
do you mean it is not possible to solve it ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 07:03 PM
11-08-2006 07:03 PM
Re: Unable to list file
if I remember correctly the message appears in connection with listing files when using wildcards, e.g. "ls a*", and it will expand to more than 200 file names.
You have to use the wildcards in such a way that they will expand to less than 200 files - or whatever the number is.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 07:13 PM
11-08-2006 07:13 PM
Re: Unable to list file
to use find.
find /yourdir/* -prune -xdev -type f -exec ls -l {} \;
If subdir are included (not in your case I think, but since we are on the subject,
I may as well let it out:)
I make a loop.
for i in $(ls -lp | grep "/")
do
find /yourdir/* -prune -xdev -type f -exec ls -l {} \;
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 07:21 PM
11-08-2006 07:21 PM
Re: Unable to list file
You solve it by listing all of the files and doing grep. Or as John says, use wild cards that match fewer files, then do multiple ls(1). You may try what Steven said, use the posix shell, sh.
>john: than 200 files - or whatever the number is
I have a directory with > 5000 files, so it is greater than 200. It will depend on the length of each name. It think the total size is at least 1 Mb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2006 10:03 PM
11-08-2006 10:03 PM
Re: Unable to list file
though Franks solution will work, it may take ages until the command finishes.
Look for this alternatives:
1) ls | fgrep 'string'
ls | grep 'regex-pattern'
2) First filter, then look for additional info:
find . -prune -type f -name 'filematch-pattern'
find . -prune -type f -name 'filematch-pattern' | xargs ls -ld
find . -prune -type f | xargs ls -ld
Bounds for the limiting values of arg_max are found in /usr/include/limits.h
I just don't have a HP at hand, but you can dive into SAM to check, if that value is a changeable kernel param - but I do not recommend this.
mfG Peter