centOs之命令搜索命令where和which

Centos之命令搜索命令whereis与which

 

whereis 命令名

#搜索命令所在路径及帮助文档所在位置

选项:

 -b :只查找可执行文件位置

 -m:只查找帮助文件

 

[root@localhost ~]# whereis ls

ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz

[root@localhost ~]# whereis -b ls

ls: /usr/bin/ls

[root@localhost ~]# whereis -m ls

ls: /usr/share/man/man1/ls.1.gz

我们可以查到ls命令的位置以及帮助文档的位置

 

 

which 文件名

搜索命令所在路径及别名

[root@localhost ~]# which ls

alias ls='ls --color=auto'

/usr/bin/ls

 

相比 ,多了个别名; 
posted @ 2018-03-08 14:04  1斑点  阅读(344)  评论(0编辑  收藏  举报