Let's review the previous section:
1. Default Permissions and Umask
2. View the file Type files command
3. Find File Search command
Job: Create a Test.txt file in the/tmp directory, view the file's default permissions, use the Find command to find the file you just created, and use the file command to view the type of files you just created
Touch/tmp/test.txt
Find/-name Test.txt
File/tmp/test.txt
This section looks at several other commands for finding:
1. Locate command
The Locate command, unlike the Find command, relies on a database file, that is, the locate command checks the data directly from the database, not from the file system, so the query is faster than find, but because of the database dependency, if the database is not updated, You may not be able to find the latest data. You can update the database with the UpdateDB command. The following example illustrates the use of the locate command.
Create a Test.txt file
With the Find command, you can find the file you just created
But with the locate command, but can not find the file just now, after the execution of a updatedb, again with locate will be able to find
UpdateDB commands the Linux system to execute automatically every day, for files with low real-time requirements can not be executed manually updatedb command
2. which and Whereis commands
The which command is used to find the absolute path to an executable file from a directory defined by the system's path variable. For example, to find the path to the LS command
The Whereis command is similar to which usage, except that Whereis can find the relevant man file in addition to the binary file, or the LS command as an example.
Job: Create a file myfile.txt, find it with locate, and find the CD command with which and Whereis, respectively.
Follow the public number "get kicked genius" for free video + graphic Tutorials
Linux Command Learning Series 12-locate,whereis,which command