In Unix, how do I get a recursive directory listing?
If you want a recursive directory listing in Unix, one of the following may be useful:
ls -R |
Not all versions of ls
have -R
|
find . -print |
Should work everywhere |
du -a . |
Shows you both the name and size |
If you're looking for a wildcard pattern that will match
all .c files in and below a certain directory, you won't
find one, but you can use:
some-command `find . -name '*.c' -print`
Replace some-command with the command you want to run.
Note: This information comes from the Unix
FAQ, which is posted regularly to the Usenet
newsgroups comp.unix.questions and
comp.unix.shell. You can obtain it by FTP from
rtfm.mit.edu in the /pub/usenet directory,
and on the web at:
http://www.faqs.org/faqs/unix-faq/faq/
Also see:
- In Unix, how do I list the files in a directory?
- In Unix, how do I determine my current working directory?
- In Unix, how do I create a new directory?
This is document abef in domain all.
Last modified on March 12, 2008.
Last modified on March 12, 2008.
Please tell us, did you find the answer to your question?






