When comparing locate vs ack, the Slant community recommends locate for most people. In the question“What are the best desktop search tools for Linux?” locate is ranked 1st while ack is ranked 7th. The most important reason people chose locate is:
locate updates its database usually daily and from there it can retrieve matching file names almost instantly.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Near instant file name matching
locate updates its database usually daily and from there it can retrieve matching file names almost instantly.
Pro Installed by default on most distributions
The "locate" command is probably already installed and setup on your Linux. Just run it.
Pro Regexp option
Uses the extended POSIX regex.
Pro Search term highlighting in results
ack will highlight parts of each row that match the search expression.
Pro Fewer false positive search results than grep
Cons
Con Cannot search inside files' content
Locate only search by file name and has no knowledge of their content. Yet it can be mixed together with tools like xargs
and grep
to look inside content of possibly relevant files quickly.