Unix search command for current working directory

The locate command on Unix will return the path associated with the specified attribute (for example, locate abc_file). What is the command to search for a file in the current working directory structure?

+3
source share
2 answers

On the other hand, you can also always use oldschool find :

find . -name abc_file
+6
source

If you use wildcards (how *), locateconsider the pattern an absolute path. Therefore, you can, for example, do:

locate "$PWD*/abc_file"

Here all files abc_fileunder your $PWDand its subfolders will be found (while they are in the location database).

+5
source

All Articles