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.
Ubuntu – Find file or directory in whole directory structure
bashdirectoryfind
Related Question
- Ubuntu – Using locate to find a directory
- Ubuntu – Find directories that DON’T contain a file
- Ubuntu – How to exclude a directory by name using find
- Ubuntu – How to find executables
- Ubuntu – Find file by matching on its path
- Ubuntu – Recursive bash script to collect information about each file in a directory structure
Best Answer
No,
find
by default traverses all available levels: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 exampleThe
-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