find

中級
1/10
user@linux:~/workspace$
find . -name "file.txt"

Explanation

Searches for all files named "file.txt" under the current directory (.).

Options

-aAND — implicit between two predicates, can be written explicitly
-oOR — match any of the joined conditions
-nameSearch by filename (pattern matching)
-inameCase-insensitive filename search
-type fSearch regular files only
-type dSearch directories only
-size +NFiles larger than N
-size -NFiles smaller than N
-mtime -NModified within N days
-mtime +NModified more than N days ago
-emptyEmpty files/directories
-printDisplay results (default)
-deleteDelete found files
-execExecute command on results
-lsDisplay with detailed info
-notNOT — negate the following predicate