I often use "locate" command on CentOs to find files.
What's the alternative for this command on Debian ?
sudo apt-get install locate
As the word itself suggests to locate files maybe you can install
locate command, from the original GNU findutils (code here), or from the new implementation Debian buster (on the right side the link to the sources).
To locate only the binary, source, and manual page files for a command you can always use
whereis, remembering that whereis has a hard-coded path, so it may not always find what you're looking for (if not included in that hard-coded path).
The whereis command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/
which instead locates a command and returns the pathnames of the files (or links) which would be executed in the current environment, by searching the $PATH for executable files matching the names of the arguments.
If used with
-a option it will print all matching pathnames of each argument.
Less efficient in terms of time, more slow because there isn't a database, it can result more efficient in terms of solutions proposed. Locate needs that the database is updated, (run
updatedb frequently), if not you will have a partial or wrong result. Moreover, it is possible that some extensions or directories are excluded from the database (see
If you are searching only for a program indexed with a database, you can see projects for desktop such as Nepomuk, Strigi, Soprano KDE, Virtuoso and Akonadi, but even Deskbar-applet, Beegle for Gnome. They are somehow similar to the discontinued Google Desktop.
Some of the database systems can be used from command line too.
You can have
locate on Debian as well—you may just need to install it. There are (at least) two implementations available, in the locate and mlocate packages.
Installing either one will give you a
The mlocate version has some additional features (hiding names based on permissions, faster indexing).
I use it to look inside source code/files and this alias similar to mlocate for filenames:
alias superlocate='bash -xc '\''ag -g $0 --hidden'\'' 2>/dev/null'