[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/p/13843301.html