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

 

相比 ,多了個別名;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM