[Linux]常用命令之【which/whereis/whatis】
1 which
shows the full path of (shell) commands.
显示(系统)命令所在目录
[root@test ~]# which ls
alias ls='ls --color=auto'
/bin/ls
[root@test ~]# which ll
alias ll='ls -l --color=auto'
/bin/ls
[root@test ~]# which sshd
/usr/sbin/sshd
[root@test ~]# which mysqld
/usr/sbin/mysqld
[root@test ~]# which mysql
/usr/bin/mysql
2 whereis
locate the binary, source, and manual page files for a command
除了可查看此命令所在的路径,还可以查看此文件相关的帮助文档所在路径
[root@test ~]# whereis ls
ls: /bin/ls /usr/share/man/man1/ls.1.gz
[root@test ~]# whereis sshd
sshd: /usr/sbin/sshd /usr/share/man/man8/sshd.8
[root@test ~]# whereis mysqld
mysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz
[root@test ~]# whereis which
which: /usr/bin/which /usr/share/man/man1/which.1.gz
3 whatis
解释命令的意义/功能;获得此命令的索引的简短说明信息
备注:许多Linux系统中并未默认安装此软件,需手动下载、安装。
可等效于apropos
/ man <command>
/ <command> --help
注:
apropos : search the manual page names and descriptions
man : manual
X 参考文献
本文作者:
千千寰宇
本文链接: https://www.cnblogs.com/johnnyzen
关于博文:评论和私信会在第一时间回复,或直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
日常交流:大数据与软件开发-QQ交流群: 774386015 【入群二维码】参见左下角。您的支持、鼓励是博主技术写作的重要动力!
本文链接: https://www.cnblogs.com/johnnyzen
关于博文:评论和私信会在第一时间回复,或直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
日常交流:大数据与软件开发-QQ交流群: 774386015 【入群二维码】参见左下角。您的支持、鼓励是博主技术写作的重要动力!