Which view the location of the executable file
Whereis View the location of the file
Locate view file location with database
Find actual search hard disk query file name
1, which
Which is looking for executables through the PATH environment variable, so the basic function is to find executable files
2 Whereis
Whereis lookups are very fast compared to find, because the Linux system records all the files in the system in a database, and when you use the Whereis and the locate that are about to be described below, you look up data from the database, unlike the Find command, By traversing the hard drive to find, the efficiency is naturally high.
However, the database file is not a real-time update, by default, updated once a week, so we use Whereis and locate to find the file will always find the data has been deleted, or just set up a file, but can not find, because the database file has not been updated.
3, locate
Locate file or directory name
4, find
Grammar:
Find path parameters
Parameter description
Time Lookup Parameters:
-atime N: Lists files that have been accessed in n*24 hours
-ctime N: List the changes in n*24 hours, new files, or directories
-mtime: Lists the files or directories that have been modified within n*24 hours
-newer file: Make a list of files that are newer than file
Name Super Find parameters:
-gid N: Searching for files with group ID n
-group Name: Search for files with group names of name
-uid N: Looking for files with owner ID n
-user Name: Find a file with a user name called name
-name file: Looking for files with file-life files
When we can't find the files we need with Whereis and locate, we can use finding, but find is traversing the hard disk, so it's very inefficient, so we recommend that you use Whereis and locate first.