1
2
3 |
[root@tshare365 ~] # whereis --help whereis [ -sbmu ] [ -SBM dir ... -f ] name... [root@tshare365 ~] # |
-b 只查找二进制文件 -m 只查找帮助文件 -s 只查找源代码 -u 排除指定类型文件 -f 只显示文件名 -B <目录> 在指定目录下查找二进制文件 -M <目录> 在指定目录下查找帮助文件
-S <目录> 在指定目录下查找源代码
1
2
3
4
5 |
[root@tshare365 ~] # whereis -b ls ls : /bin/ls [root@tshare365 ~] # rpm -qf /bin/ls coreutils-8.4-31.el6.x86_64 [root@tshare365 ~] # |
看到whereis的用法了吧,还是相当有用的,如果我们系统中有一个命令,但是我们确不知道是通过什么软件包安装的时候whereis还是可以帮助的,如果你对rpm的命令不熟悉请点击 rpm详解
1
2
3
4
5 |
[root@tshare365 ~] # which grep /bin/grep [root@tshare365 ~] # which ls alias ls = 'ls --color=auto' /bin/ls |
1
2
3
4
5
6
7
8 |
[root@tshare365 ~] # type cd cd is a shell builtin #builtin表示命令是shell内部命令,也是shell本身自带的 [root@tshare365 ~] # type grep grep is /bin/grep [root@tshare365 ~] # type -p grep /bin/grep [root@tshare365 ~] # |
1
2
3 |
[root@tshare365 ~] # locate tshare365 /root/tshare365 [root@tshare365 ~] # |