ls [message #288046] |
Fri, 14 December 2007 08:24 |
kshitij.raj
Messages: 7 Registered: July 2007
|
Junior Member |
|
|
Hi,
Could you please tell me that what is the limitation of using ls *.* in terms of number of files or size.
Sometimes, i get error as "argument list too long".
[Updated on: Fri, 14 December 2007 08:40] Report message to a moderator
|
|
|
Re: ls [message #288047 is a reply to message #288046] |
Fri, 14 December 2007 08:34 |
ritvikd
Messages: 11 Registered: January 2007
|
Junior Member |
|
|
ls *.* under specific directory will show all files under that directory irrespective of filename and extension. Note that it won't show you hidden files.
|
|
|
|
Re: ls [message #288083 is a reply to message #288047] |
Fri, 14 December 2007 13:23 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
ritvikd wrote on Fri, 14 December 2007 15:34 | ls *.* under specific directory will show all files under that directory irrespective of filename and extension. Note that it won't show you hidden files.
|
Actually, it will show all (non-hidden) files and directories with a DOT in the name.
Under Linux/Unix there are a lot of files which don't have a dot in the name, since the extension is not needed as much as it is in Windows. And directories don't have dots in them very often.
As for the "Argument List To Long" problem:
When you run "ls" only, it simply lists all files in the directory.
When you run "ls *" a list with all files in the directory is created, and passed to ls. That's why ls also lists the contents of directories one level down, when you run it that way.
There you run into the limit of command line parameters (which is 131072 under Linux, I think)
Instead of
You can use, for example,
find . -iname "*pattern*" | xargs ls
If you run into "argument list too long" problems. Note the quotes around *patter*, which tell the shell to pass *pattern* to find as it is, not to try to create an argument list out of it.
|
|
|