wher">
The whereis command is specifically used to search for program names. It can search binary files (using the -b parameter), man description files (using the -m parameter) and source code files (using the -s parameter). Without any parameters, it returns all relevant information.
Compared with the find command, the search speed of the whereis command is very fast. This is because the Linux system records all file information in a database file. When we use whereis or the locate command to be introduced next, it will find the data directly from the database instead of traversing the hard disk like the find command, so it is more efficient.
”
The message has been received. The following is the result of deep pseudo-originalization of the paragraph you provided: > The whereis command is specially used to search for program names. It can search for binary files (using the -b parameter) and man description files (using -m parameter) and source code files (using the -s parameter). Without any parameters, it returns all relevant information. > Compared with the find command, the search speed of the whereis command is very fast. This is because the Linux system records all file information in a database file. When we use whereis or the locate command to be introduced next, it will find the data directly from the database instead of traversing the hard disk like the find command, so it is more efficient.
“
However, the database file is not updated in real time. By default, it is updated once a week. Therefore, when we use whereis and locate to search for files, we sometimes find data that has been deleted, or the file has just been created but cannot be found. The reason is that the database file has not been updated.
”
whereis [参数]... 文件名
“
Thewhereis command is to locate the location of executable files, source code files, and help files in the file system. The attributes of these files should belong to original code, binary files, or help files. The whereis program also has the ability to search source code, specify alternative search paths, and search for unusual items.
”
ls
命令位置和帮助文档的位置> whereis ls ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz
ls
命令的二进制程序> whereis -b ls ls: /usr/bin/ls
ls
命令的帮助文档> whereis -m ls
The above is the detailed content of Linux whereis command. For more information, please follow other related articles on the PHP Chinese website!