Linux command man whatis

当我们学习 Linux 命令时,会发现很多命令,有时候命令的用法会记得不清楚,那么怎么通过仅存的片段记忆知道命令的正确用法呢?我们可以通过Linux系统内置的命令帮助获取帮助。

下面简短介绍一些系统内置的命令帮助命令

命令 命令说明
whatis 查看命令的简要说明
info 比whatis更详细的介绍
which 查看程序的二进制文件所在路径
whereis 用于查找文件
man 查看命令的说明文档

whatis

用法

snowflake@snowflake-desktop:/etc/samba$ whatis man
man (1)              - 在线参考手册的接口
man (7)              - macros to format man pages
snowflake@snowflake-desktop:/etc/samba$ whatis whatis
whatis (1)           - 显示在线手册页说明
snowflake@snowflake-desktop:/etc/samba$ whatis sudo
sudo (8)             - execute a command as another user

info

查看更详细的命令文档

which

which指令会在环境变量$PATH设置的目录里查找符合条件的文件。

用法

snowflake@snowflake-desktop:/etc/samba$ which man
/usr/bin/man
snowflake@snowflake-desktop:/etc/samba$ which bash
/bin/bash
snowflake@snowflake-desktop:/etc/samba$ which which
/usr/bin/which

whereis

snowflake@snowflake-desktop:/etc/samba$ whereis man
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man7/man.7.gz /usr/share/man/man1/man.1.gz
snowflake@snowflake-desktop:/etc/samba$ whereis whereis
whereis: /usr/bin/whereis /usr/share/man/man1/whereis.1.gz
snowflake@snowflake-desktop:/etc/samba$ whereis sudo
sudo: /usr/bin/sudo /usr/lib/sudo /usr/share/man/man8/sudo.8.gz

[注意]:注意:以上输出信息从左至右分别为查询的程序名、命令路径、命令的man 手册页路径。

man

而对于命令的具体参数及使用方法,我们需要用到强大的man;

发布了80 篇原创文章 · 获赞 13 · 访问量 9245

猜你喜欢

转载自blog.csdn.net/qq_39424178/article/details/100837786