Centos之命令搜索命令whereis與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
相比 ,多了個別名;