This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 437090 - ls * in sub-folders with > 100k files "Argument list too long"
ls * in sub-folders with > 100k files "Argument list too long"
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: bash (Show other bugs)
4.8
All Linux
low Severity medium
: rc
: ---
Assigned To: Roman Rakus
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-12 07:40 EDT by ITT Tech
Modified: 2014-01-12 19:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-17 09:50:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description ITT Tech 2008-03-12 07:40:53 EDT
Description of problem:

ls * in  sub-folders with > 100k files returns:
-bash: /bin/ls: Argument list too long

Version-Release number of selected component (if applicable):


How reproducible:
on dirs with files > 100k always

Steps to Reproduce:
1. go to a dir with files > 100k
2. ls *
3.
  
Actual results:
-bash: /bin/ls: Argument list too long


Expected results:
list

Additional info:
`ls *' in large directories, the star
gets expanded by bash to all filenames in the dir

any chance bash can be improved so ls * doesn't expanded all filenames in dir
Comment 1 Tomas Janousek 2008-03-21 06:53:24 EDT
Well, ls should expand to all filenames. If you're working with that many files,
use xargs (e.g. ls -a | xargs -d '\n' ls -d), that will split the list of files
automatically.
Comment 2 RHEL Product and Program Management 2008-09-05 13:15:18 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 RHEL Product and Program Management 2008-09-17 09:50:19 EDT
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.
Comment 5 ITT Tech 2008-10-17 04:35:45 EDT
that just silly when u consider the amount of files on a SAN & the may will be in one location. 

if i use nscd will ls handle > 100K files?
Comment 6 Roman Rakus 2008-10-17 04:44:28 EDT
Yes, it will (depending on amount of RAM).
Comment 7 Ondrej Vasik 2008-10-17 06:05:06 EDT
Just want to mention that aproximate number of files which could be handled by ls is in range of milions (it depends on the architecture and RAM). This limitation is solved for unsorted one-file-per-line ls format in latest upstream and will be solved in RHEL-5.3 coreutils update. There are no plans to remove that limitation in RHEL-4 coreutils at the moment, but I guess listing of ~6M files is very uncommon usage of ls.
Comment 8 ITT Tech 2008-10-20 11:16:44 EDT
thanks for feedback glad to hear it will be in rhel5 :)

Note You need to log in before you can comment on or make changes to this bug.