Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I find a file with a specific name in bash. I want to search through the whole system. I tried with find, but that only work through one level.

share|improve this question
up vote 11 down vote accepted

No, find by default traverses all available levels:

sudo find / -mount -name 'myfilename'

If you have a separate home partition, or a encrypted home, or a secondary hard drive, you may want to list their mount points too, next to /, for example

sudo find / /home/enzotib /media/data -mount -name 'myfilename'

The -mount option is needed to avoid to traverse mounted filesystems. Among these there are /proc, /dev and /sys, that is convenient to skip.

An alternative to traverse all files, avoiding only these last three paths is

sudo find /!(proc|sys|dev) -name 'myfilename'
share|improve this answer
to find all files starting with "my" do: find . -name my\* (bash would interpret the star if there were no slash) – krumpelstiltskin Dec 2 '11 at 20:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.