I am using the
locate command on Linux. My current usage of it searches through the entire filesystem. I only want it to search within a specific directory. How can I do this?
Another approach would be to use the pattern matching in
Compare the output of the commands below:
The simplest answer I can think of is
The better solution might be to use "find" and its path options...
Create slocate database for your specific directory with:
and search with:
This works fine on my Gentoo system but CentOS doesn't include
Build the database with: