What are the differences among whereis
, locate
and find
commands on Ubuntu ? What are the basic differences from the searching point of view ?
Ubuntu – Difference among “whereis ” , “locate ” and “find”command
command linefindlocate
command linefindlocate
What are the differences among whereis
, locate
and find
commands on Ubuntu ? What are the basic differences from the searching point of view ?
Best Answer
From GNU findutils help page
So
find
is what you use when you want to search by particular criteria and also manipulate files. It has many more options thanlocate
so allows far more fine-grained control of results. It is slow because it performs the requested test(s) on every file to see if it matches.locate
is used to scan the whole system quickly for something - you might use this when you have no idea where something is, or when you want to find all related files scattered across various unknown places. It's fast because it uses a binary database to index the system. To get new files to show up, first runsudo updatedb
(the database it updated once per day bycron
the
whereis
command simply returns the location of the executables, the man pages and the sources of a program (seeman whereis
)