The locate command in Unix will return the path related to the attribute given (for example, locate abc_file
). What is the command to locate a file in the present working directory structure?
If you use wildcards (as *
) locate
considers the pattern to be an absolute path. Therefore you could e.g. do:
locate "$PWD*/abc_file"
This will find all files abc_file
under your $PWD
and its subfolders (as long as they are in the locate database).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With