开发者

Unix locate command for present working directory

The locate command in Unix will return the path related to the attribute given (for example, locate abc_file). Wh开发者_高级运维at 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).


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

find . -name abc_file
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜