← 返回命令列表

Linux command

whereis 命令

网络

需要网络或远程资源。

常用示例

Example

whereis ssh

Example

whereis -bm ls

Example

whereis -s gcc -m git

Example

whereis -b -B /usr/bin/ -f gcc

Example

whereis -u *

Example

whereis -u -m *

说明

whereis locates the binary, source, and manual page files for a command by searching a set of standard locations. Unlike which, it searches predefined directories rather than the PATH variable, and can find source and documentation files. The command uses hardcoded directory lists that may include /bin, /sbin, /usr/bin, /usr/share/man, /usr/src, and similar system directories. Use -l to see the actual search paths on your system.

参数

-b
Search only for binaries
-m
Search only for manual sections
-s
Search only for sources
-u
Search for unusual entries (commands with more than one binary, or no manual)
-B _list_
Limit binary search to specified directories
-M _list_
Limit manual search to specified directories
-S _list_
Limit source search to specified directories
-f
Terminate directory list (required when using -B, -M, or -S)
-l
Output list of effective search paths

FAQ

What is the whereis command used for?

whereis locates the binary, source, and manual page files for a command by searching a set of standard locations. Unlike which, it searches predefined directories rather than the PATH variable, and can find source and documentation files. The command uses hardcoded directory lists that may include /bin, /sbin, /usr/bin, /usr/share/man, /usr/src, and similar system directories. Use -l to see the actual search paths on your system.

How do I run a basic whereis example?

Run `whereis ssh` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -b do in whereis?

Search only for binaries