1. --help
help命令用来显示shell内部命令的帮助信息。
help命令只能显示shell内部的命令帮助信息。而对于外部命令的帮助信息只能使用man或者info命令查看。
命令 | 用途 |
命令 + --help | 查看命令的基本用法 |
[内容] | 在执行过程中可加可不加 |
... | 加入的内容个数任意 |
<> | 在执行操作时必须加入 |
实例:
[root@localhost Desktop]# passwd --help
Usage: passwd [OPTION...] <accountName>
-k, --keep-tokens keep non-expired authentication tokens
-d, --delete delete the password for the named account (root
only); also removes password lock if any
-l, --lock lock the password for the named account (root only)
-u, --unlock unlock the password for the named account (root only)
-e, --expire expire the password for the named account (root only)
-f, --force force operation
-x, --maximum=DAYS maximum password lifetime (root only)
-n, --minimum=DAYS minimum password lifetime (root only)
-w, --warning=DAYS number of days warning users receives before
password expiration (root only)
-i, --inactive=DAYS number of days after password expiration when an
account becomes disabled (root only)
-S, --status report password status on the named account (root
only)
--stdin read new tokens from stdin (root only)
Help options:
-?, --help Show this help message
--usage Display brief usage message
2. whatis
whatis命令查询一个命令执行什么功能,并将查询结果打印出来。
命令 | 用途 |
whatis + 命令名称 | 查看命令的用途 |
实例:
[root@localhost Desktop]# whatis passwd
passwd (5) - password file
openssl-passwd (1ssl) - compute password hashes
passwd (1) - update user's authentication tokens
3. man
命令 | 用途 |
man 选项 参数(级别、对象) | 通过man指令可以查看Linux中的指令帮助、配置文件帮助和编程帮助等信息 |
选项 | 用途 |
-a | 在所有的man手册中搜索,显示所有匹配项 |
-f | 显示命令的简短描述信息 |
-P/-p | 指定内容时使用分页程序,注意在-p后输入所分页数 |
-M/-m | 指定man手册搜索路径 |
-k | 模糊查找关键字 |
-d/-D | 搜索路径信息,不显示手册页内容 |
级别 | 意义 |
1 | 命令 |
2 | 系统调用 |
3 | 函数调用 |
4 | 系统特殊文件 |
5 | 系统配置文件 |
6 | 游戏 |
7 | 特殊包 |
8 | 系统管理命令 |
9 | 内核规则 |
实例:
man -k passwd ## 搜索whatis数据库,模糊查找关键字
chgpasswd (8) - update group passwords in batch mode
chpasswd (8) - update passwords in batch mode
fgetpwent_r (3) - get passwd file entry reentrantly
getpwent_r (3) - get passwd file entry reentrantly
gpasswd (1) - administer /etc/group and /etc/gshadow
grub2-mkpasswd-pbkdf2 (1) - Generate a PBKDF2 password hash.
lpasswd (1) - Change group or user password
openssl-passwd (1ssl) - compute password hashes
pam_localuser (8) - require users to be listed in /etc/passwd
passwd (1) - update user's authentication tokens
passwd (5) - password file
passwd2des (3) - RFS password encryption
pwhistory_helper (8) - Helper binary that transfers password hashes from pass...
saslpasswd2 (8) - set a user's sasl password
smbpasswd (5) - The Samba encrypted password file
sslpasswd (1ssl) - compute password hashes
userpasswd (1) - A graphical tool to allow users to change their passwo...
vncpasswd (1) - change the VNC password