首页
首页 » 文件管理 » whereis

whereis

whereis
功能说明:查找文件。
语  法:whereis [-bfmsu][-B <目录>...][-M <目录>...][-S <目录>...][文件...]
补充说明:whereis指令会在特定目录中查找符合条件的文件。这些文件的烈性应属于原始代码,二进制文件,或是帮助文件。
参  数:
 -b  只查找二进制文件。 
 -B<目录>  只在设置的目录下查找二进制文件。 
 -f  不显示文件名前的路径名称。 
 -m  只查找说明文件。 
 -M<目录>  只在设置的目录下查找说明文件。 
 -s  只查找原始代码文件。 
 -S<目录>  只在设置的目录下查找原始代码文件。 
 -u  查找不包含指定类型的文件。

whereis

whereis [options] files

Locate the binary, source, and manual page files for specified commands/files. The supplied filenames are first stripped of leading pathname components and any (single) trailing extension of the form .ext (for example, .c). Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in a list of standard Linux directories (/bin, /etc, /usr/bin, /usr/local/bin/, etc.).

Options

-b

Search only for binaries.

-f

Terminate the last directory list and signal the start of filenames. Required when the -B, -M, or -S option is used.

-m

Search only for manual sections.

-s

Search only for sources.

-u

Search for unusual entries—that is, files that do not have one entry of each requested type. Thus, the command whereis -m -u * asks for those files in the current directory that have no documentation.

-B directories

Change or otherwise limit the directories to search for binaries.

-M directory

Change or otherwise limit the directories to search for manual sections.

-S directory

Change or otherwise limit the directories to search for sources.

Example

Find all files in /usr/bin that are not documented in /usr/share/man/man1 but that have source in /usr/src:

$ cd /usr/bin $ whereis -u -M /usr/share/man/man1 -S /usr/src -f *