? whatis
???? 基于數據庫的查找,查找內容比較慢
???????? 優點:查找速度快
???????? 缺點:沒有實時性
[root@localhost ~]# whatis ls ls (1) - list directory contents ls (1p) - list directory contents
? ? ? 數據庫文件
???????? Centos6:/var/cache/man/whatis
???????? Centos7:/var/cache/man/index.db
???? 更新數據庫文件
???????? Centos6:makewhatis
???????? Centos7:mandb
? ?? help
? ? help是一個內部命令,help命令只能顯示shell內部的命令幫助信息。而對于外部命令的幫助信息只能使用man或者info命令查看
?
[root@localhost ~]# type help help is a shell builtin
? ? help cd ?? //查看cd的幫助
[root@localhost ~]# help cd cd: cd [-L|[-P [-e]]] [dir]Change the shell working directory.Change the current directory to DIR. The default DIR is the value of theHOME shell variable.The variable CDPATH defines the search path for the directory containingDIR. Alternative directory names in CDPATH are separated by a colon (:).A null directory name is the same as the current directory. If DIR beginswith a slash (/), then CDPATH is not used.If the directory is not found, and the shell option `cdable_vars' is set,the word is assumed to be a variable name. If that variable has a value,its value is used for DIR.Options:-L force symbolic links to be followed-P use the physical directory structure without following symboliclinks-e if the -P option is supplied, and the current working directorycannot be determined successfully, exit with a non-zero statusThe default is to follow symbolic links, as if `-L' were specified.Exit Status:Returns 0 if the directory is changed, and if $PWD is set successfully when-P is used; non-zero otherwise.help pwdhelp enablels --help
man ? ?
中文man使用方法:
???? 1.? 掛載光盤
???? mount /dev/cdrom /media/
???? 2.? 安裝中文man的軟件包
???? rpm -ivh /media/Packages/man-pages-zh-CN-1.5.2-4.el7.noarch.rpm
[root@localhost ~]# mount /dev/cdrom /media/ mount: /dev/sr0 is write-protected, mounting read-only [root@localhost ~]# rpm -ivh /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm warning: /media/Packages/screen-4.1.0-0.25.20120314git3c2946.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY Preparing... ################################# [100%] Updating / installing...1:screen-4.1.0-0.25.20120314git3c29################################# [100%
? ? 3. 將中文man的路徑寫的man的配置文件
? ? ? ?? gedit /etc/man_db.conf 增加一行,內容如下
???????? MANDATORY_MANPATH??????????? /usr/share/man/zh_CN
???? 4.man -a ls? 查看ls
[root@localhost ~]# man -a ls LS(1) User Commands LS(1) NAMEls - list directory contents SYNOPSISls [OPTION]... [FILE]... DESCRIPTIONList information about the FILEs (the currentdirectory by default). Sort entries alphabeti‐cally if none of -cftuvSUX nor --sort is speci‐fied.
? q退出man命令
??? man的使用
???? f向下翻一頁
???? b向上翻一頁
???? d向下翻半頁
???? u向上翻半頁
???? ** G 跳至尾頁
???? ** g 跳至首頁
???? ** 搜索關鍵字
???????? /關鍵字? n 向下? N向上
???????? ?關鍵字? n 向上?
???? q 退出man
??? man的章節,man的關鍵字有多個文件與之匹配,則按類型,劃分為以下9個章節
????? * 1?? Executable programs or shell commands
??????? 2?? System calls (functions provided by the kernel)
??????? 3?? Library calls (functions within program libraries)
??????? 4?? Special files (usually found in /dev)
????? * 5?? File formats and conventions eg /etc/passwd
??????? 6?? Games
??????? 7?? Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
????? * 8?? System administration commands (usually only for root)
??????? 9?? Kernel routines [Non standard]
??? man 章節號 關鍵字 (若省略章節號,則顯示數字較小的章節)
??? man -a 關鍵字?? 依次查看指定關鍵字的所有章節
[root@localhost ~]# man -a issue ISSUE(5) Linux Programmer's Manual ISSUE(5) NAMEissue - prelogin message and identificationfile DESCRIPTIONThe file /etc/issue is a text file which con‐tains a message or system identification to beprinted before the login prompt. It may con‐tain various @char and \char sequences, if sup‐ported by the getty-type program employed onthe system. FILES/etc/issue SEE ALSOmotd(5), agetty(8), mingetty(8)
?
???? man -w 關鍵字 查看關鍵字匹配到的第一個章節的來源文件
???? man -aw 關鍵字 查看關鍵字匹配到的所有章節的來源文件
???? man -f 關鍵字 等于 whatis 關鍵字