1. 程式人生 > >(十一)Centos之幫助命令

(十一)Centos之幫助命令

play ken -h spa ... prop 雜項 als exp

幫助命令man (manual)

比如我們可以看下man命令的解釋

[root@localhost ~]# man man

MAN(1) Manual pager utils MAN(1)

NAME

man - an interface to the on-line reference manuals

SYNOPSIS

man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-m system[,...]] [-M path] [-S list] [-e exten‐

sion] [-i|-I] [--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P pager] [-r prompt] [-7] [-E encoding]

[--no-hyphenation] [--no-justification] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section]

page ...] ...

man -k [apropos options] regexp ...

man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...

man -f [whatis options] page ...

man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-P pager] [-r prompt] [-7] [-E encoding] [-p

string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] file ...

man -w|-W [-C file] [-d] [-D] page ...

man -c [-C file] [-d] [-D] page ...

man [-?V]

DESCRIPTION

man is the system‘s manual pager. Each page argument given to man is normally the name of a program, utility or function.

The manual page associated with each of these arguments is then found and displayed. A section, if provided, will direct

man to look only in that section of the manual. The default action is to search in all of the available sections, follow‐

Manual page man(1) line 1 (press h for help or q to quit)

查看完 按 "q"鍵,離開

我們看下ls

man ls

技術分享圖片

這裏其實有很多行 我們可以按鍵盤的向下鍵盤,來顯示下方隱藏的內容;

當然也可以搜索

/ 加搜索內容

比如搜索 -d

/-d

技術分享圖片

技術分享圖片

這裏的1是man的級別; 這裏的1是查看命令的幫助

1:查看命令的幫助

2:查看可被內核調用的函數的函數的版主

3:查看函數和函數庫的幫助

4:查看特殊文件的幫助(主要是/dev目錄下的文件)

5:查看配置文件的幫助

6:查看遊戲的幫助

7:查看其他雜項的幫助

8:查看系統管理員可用命令的幫助

9:查看和內核相關文件的幫助

查看命令擁有哪個級別的幫助

man -f 命令

相當於

whatis 命令

舉例

man -5 passwd

man -4 null

man -8 ip

比如查看ls的命令級別

[root@localhost ~]# man -f ls

ls (1) - list directory contents

[root@localhost ~]#

只有1個

[root@localhost ~]# man -f ip

ip (8) - show / manipulate routing, devices, policy routing...

[root@localhost ~]#

查看和命令相關的所有幫助

man -k 命令

相當於

appropos 命令

例如

apropos passwd

[root@localhost ~]# man -k passwd

chpasswd (8) - 批量更新密碼

gpasswd (1) - 管理員 /etc/group 和 /etc/gshadow

grub2-mkpasswd-pbkdf2 (1) - Generate a PBKDF2 password hash.

lpasswd (1) - Change group or user password

pam_localuser (8) - require users to be listed in /etc/passwd

passwd (1) - update user‘s authentication tokens

sslpasswd (1ssl) - compute password hashes

pwhistory_helper (8) - Helper binary that transfers password hashes from ...

[root@localhost ~]#

能把相關的命令都查詢出來;

(十一)Centos之幫助命令