Finding a file

software development


In DOS, I can do a
dir /s /b ralph.txt
and it will do a search of the entire directory tree, returning the path to ralph.txt:

ls -R ralph.txt
doesn’t quite cut it in linux. What does work for finding files buried in a directory tree?


find . -name ralph.txt
(or find /path/to/where/you/want/to/start -name ralph.txt)

find can (of course) do a lot more than this… read the man page for find for some other cool stuff.

You can, for instance, perform operations, do case insensitive searches, and find based on criteria other than filename.