How does ls work?
by johnmb12 from LinuxQuestions.org on (#53G7N)
Long time user of linux, but have always been mystified about how ls works. Must admit, expect it to work similar to DIR in Windows ie be able to search for any file, or specific files in the whole tree, but ls only seems to be useful for the current directory....
For example, trying to find all txt files in and below the current directory, expect I should be able to do:
ls -R *.txt
but this only seems to bring up the current directory?! But
ls -R
will bring up the whole tree....
Confused!
Thanks.


For example, trying to find all txt files in and below the current directory, expect I should be able to do:
ls -R *.txt
but this only seems to bring up the current directory?! But
ls -R
will bring up the whole tree....
Confused!
Thanks.