Results 11 to 13 of 13
As a sanity check, I went to my samba server which has a large number of files on it, and did the following commands, with the following results:
Code:
smbserver:/myfiles/users ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-17-2011 #11Just Joined!
- Join Date
- Aug 2006
- Posts
- 16
As a sanity check, I went to my samba server which has a large number of files on it, and did the following commands, with the following results:
*/* has about 30,000 files in it */* plus */*/* has 300273 files in it.Code:smbserver:/myfiles/users # echo */* */*/* | wc 1 300273 4932638 smbserver:/myfiles/users # ls */* -bash: /bin/ls: Argument list too long
In my book, that's as close as unlimited as I need to get.
- 08-17-2011 #12Linux User
- Join Date
- Nov 2008
- Location
- Tokyo, Japan
- Posts
- 258
Oh yes! I didn't think of that, but you're right. I've never tried it, but I don't think bash limits the arguments to its built-in functions. I'm sure your experience verifies that there are no kernel-imposed limits.
I guess I would only avoid listing files with "echo *" because it separates arguments with spaces rather than newlines, so filenames with spaces in them can cause confusion, especially when piping the output of echo to a filtering program. But if you only want to see what is there, then your technique would work just fine.
- 08-17-2011 #13Just Joined!
- Join Date
- Aug 2006
- Posts
- 16
OK, just tested echo * on 3.5 million files, and it didn't barf.
Looked at the source code for echo and for ls, and found that ls is calling getopt, and echo doesn't.
I think it's getopt that's doing the argument number limitation.


Reply With Quote

