It isn\u2019t hard to find what you\u2019re looking for on a Linux system \u2014 a file or a command \u2014\u00a0but there are a lot of ways to go looking.\n7 commands to find Linux files\nfind\nThe most obvious is undoubtedly the find command, and find has become easier to use than it was years ago. It used to require a starting location for your search, but these days, you can also use find with just a file name or regular expression if you\u2019re willing to confine your search to the local directory.\n$ find e*\nempty\nexamples.desktop\n\nIn this way, it works much like the ls command and isn't doing much of a search.\nFor more relevant searches, find requires a starting point and some criteria for your search (unless you simply want it to provide a recursive listing of that starting point\u2019s directory. The command find . -type f will recursively list all regular files starting with the current directory while find ~nemo -type f -empty will find empty files in Nemo\u2019s home directory.\n$ find ~nemo -type f -empty\n\/home\/nemo\/empty\n\n\nlocate\nThe name of the locate command suggests that it does basically the same thing as find, but it works entirely differently. Where the find command can select files based on a variety of criteria \u2014 name, size, owner, permissions, state (such as empty), etc. with a selectable depth for the search, the\u00a0locate\u00a0command looks through a file called \/var\/lib\/mlocate\/mlocate.db to find what you\u2019re looking for. That db file is periodically updated, so a locate of a file you just created will probably fail to find it. If that bothers you, you can run the updatedb file and get the update to happen right away.\n$ sudo updatedb\n\nmlocate\nThe mlocate command works like the locate command and uses the same mlocate.db file as locate.\nwhich\nThe which command works very differently than the\u00a0find and locate commands. It uses your search path and checks each directory on it for an executable with the file name you\u2019re looking for. Once it finds one, it stops searching and displays the full path to that executable.\nThe primary benefit of the which command is that it answers the question, \u201cIf I enter this command, what executable file will be run?\u201d It ignores files that aren\u2019t executable and doesn\u2019t list all executables on the system with that name \u2014 just the one that it finds first. If you wanted to find all executables that have some name, you could run a find command like this, but it might take considerably longer to run the very efficient which command.\n$ find \/ -name locate -perm -a=x 2>\/dev\/null\n\/usr\/bin\/locate\n\/etc\/alternatives\/locate\n\nIn this find command, we\u2019re looking for all executables (files that cen be run by anyone) named \u201clocate\u201d. We\u2019re also electing not to view all of the \u201cPermission denied\u201d messages that would otherwise clutter our screens.\nwhereis\nThe whereis command works a lot like the which command, but it provides more information. Instead of just looking for executables, it also looks for man pages and source files. Like the which command, it uses your search path ($PATH) to drive its search.\n$ whereis locate\nlocate: \/usr\/bin\/locate \/usr\/share\/man\/man1\/locate.1.gz\n\nwhatis\nThe whatis command has its own unique mission. Instead of actually finding files, it looks for information in the man pages for the command you are asking about and provides the brief description of the command from the top of the man page.\n$ whatis locate\nlocate (1) - find files by name\n\nIf you ask about a script that you\u2019ve just set up, it won\u2019t have any idea what you\u2019re referring to and will tell you so.\n$ whatis cleanup\ncleanup: nothing appropriate.\n\napropos\nThe apropos command is useful when you know what you want to do, but you have no idea what command you should be using to do it. If you were wondering how to locate files, for example, the commands \u201capropos find\u201d and \u201capropos locate\u201d would have a lot of suggestions to offer.\n$ apropos find\nFile::IconTheme (3pm) - find icon directories\nFile::MimeInfo::Applications (3pm) - Find programs to open a file by mimetype\nFile::UserDirs (3pm) - find extra media and documents directories\nfind (1) - search for files in a directory hierarchy\nfindfs (8) - find a filesystem by label or UUID\nfindmnt (8) - find a filesystem\ngst-typefind-1.0 (1) - print Media type of file\nippfind (1) - find internet printing protocol printers\nlocate (1) - find files by name\nmlocate (1) - find files by name\npidof (8) - find the process ID of a running program.\nsane-find-scanner (1) - find SCSI and USB scanners and their device files\nsystemd-delta (1) - Find overridden configuration files\nxdg-user-dir (1) - Find an XDG user dir\n$\n$ apropos locate\nblkid (8) - locate\/print block device attributes\ndeallocvt (1) - deallocate unused virtual consoles\nfallocate (1) - preallocate or deallocate space to a file\nIO::Tty (3pm) - Low-level allocate a pseudo-Tty, import constants.\nlocate (1) - find files by name\nmlocate (1) - find files by name\nmlocate.db (5) - a mlocate database\nmshowfat (1) - shows FAT clusters allocated to file\nntfsfallocate (8) - preallocate space to a file on an NTFS volume\nsystemd-sysusers (8) - Allocate system users and groups\nsystemd-sysusers.service (8) - Allocate system users and groups\nupdatedb (8) - update a database for mlocate\nupdatedb.mlocate (8) - update a database for mlocate\nwhereis (1) - locate the binary, source, and manual page files for a...\nwhich (1) - locate a command\n\nWrap-up\nThe commands available on Linux for locating and identifying files are quite varied, but they're all very useful.