-
Use the find command on the command line to query any of the Feast files by name.
This command supports precise fuzzy query by file name, file size, file creation time, file permissions, and file type (directory file, common file, block file, linked file, etc.).
In addition, if you think the find command is too slow to search, you can use the locate command before the ante. The principle of this command is to index all files under the Linux hard disk, and when searching, you can directly search in the index of the penitent, which is very fast, and you only need to do a scheduled task every day to generate the index.
-
Under the Linux system, the system itself comes with a file name search command, which is very powerful. The command is find. The most basic and easiest way to use it is the following:
#find / name "*c"-print where the "enter" key is used, which means that the file is searched from the root directory in the superuser state, *c"The name of the file that represents the search is the C language source program, and the print representative displays the Changfan search results on the screen slide.
-
find and locate. The difference is that find is not indexed, and in a specified directory search, you can find it in terms of specified conditions. For example, specify the path, time, user, user group, permissions, search type (file or path), etc.
And after finding the corresponding file, you can run the formulation command.
locate needs to establish an index, and the index is read directly when searching. When a file on a hard disk is added or decreased, it is necessary to index it even when changing the path.
The find command comes with the system, and the locate command needs to be installed with yum install mlocate -y, and the updatedb command is used to create the index.
-
Locate allows users to quickly search for specific files in the file system.
The method is to create a database that includes the names and paths of all the files in the system, and then when you search for it, you only need to query the database without actually going into the file system.
So you have to know:
1.Locate is faster than find because it doesn't really look up files, it looks up databases.
2.The search of locate is not real-time, but is subject to the update of the database, and is generally maintained by the system itself.
3.Upgrade database command: locate --ulocate -v version to view the usage.
-
You can use the whereis, locate, or find command to find files in Linux. If you want to search for files quickly, it is best to use the whereis or locate command, which is much faster than the find command, because there is a database in the Linux system, which records all the files in the system, and the whereis and locate commands are found in this database, and do not actually find the hard disk, and the database search is often very fast; The find command is to find the hard disk directly, if the hard disk has a large number of files, it will be more time-consuming.
Note that the database of the whereis and locate commands is updated once a day, so sometimes the deleted files will be found, and there will be cases where the latest files just created cannot be found.
whereis Usage:
find usage:
find path to find parameter.
Name parameter: Specify the name of the file to be found.
user parameter: specifies the user to whom the file to be searched belongs.
The type parameter specifies the type of file to be found, including D directory, L connection file, S socket file, etc.
-
The distinction between various types of query commands in Linux: carrying traces.
-
You don't need it.,Which、Whereis、locate、Find These tools are used very quickly.,It's much faster than anything.。
1. Linux operation and maintenance engineer: Linux operation and maintenance is now every enterprise can not lack positions, it is very important for large companies to understand the basic language, for small companies The technical requirements are relatively low, and there is basically no need for too much development knowledge. >>>More
Hello, Toyota Toyota's brands are: Lexus-Toyota high-end car representative, also known as Lexus! >>>More
<>1. The burden is very heavy, picking up the beams at home, and there are parents and children at home, who need to be taken care of. >>>More
Win7 as a new generation of operating system has been improved for a long time, and the stability and security have been greatly improved than before, and in terms of entertainment, Win7 natively supports the latest Direct >>>More
The only way to do that is to try to log in with a single user to see if root can be recovered. >>>More