Linux文件搜索命令之幫助命令

man命令

man命令是Linux下的幫助指令,經過man指令能夠查看Linux中的指令幫助、配置文件幫助和編程幫助等信息。linux

語法

man(選項)(參數)

選項

-a:在全部的man幫助手冊中搜索;
-f:等價於whatis指令,顯示給定關鍵字的簡短描述信息;
-P:指定內容時使用分頁程序;
-M:指定man手冊搜索的路徑。

參數

  • 數字:指定從哪本man手冊中搜索幫助;
  • 關鍵字:指定要搜索幫助的關鍵字。

實例

咱們輸入man ls,它會在最左上角顯示「LS(1)」,在這裏,「LS」表示手冊名稱,而「(1)」表示該手冊位於第一節章,一樣,咱們輸man ifconfig它會在最左上角顯示「IFCONFIG(8)」。也能夠這樣輸入命令:「man [章節號] 手冊名稱」。shell

man是按照手冊的章節號的順序進行搜索的,好比:編程

man sleep

只會顯示sleep命令的手冊,若是想查看庫函數sleep,就要輸入:函數

man 3 sleep

help命令

help命令用於顯示shell內部命令的幫助信息。help命令只能顯示shell內部的命令幫助信息。而對於外部命令的幫助信息只能使用man或者info命令查看。spa

語法

help(選項)(參數)

選項

-s:輸出短格式的幫助信息。僅包括命令格式。

參數

內部命令:指定須要顯示幫助信息的shell內部命令。.net

實例

使用help命令顯示shell內部shopt命令的幫助信息,輸入以下命令:rest

help shopt                #獲取shopt命令的幫助信息
shopt: shopt [-pqsu] [-o long-option] optname [optname...]
    Toggle the values of variables controlling optional behavior.
    The -s flag means to enable (set) each OPTNAME; the -u flag unsets each OPTNAME. The -q flag suppresses output; the exit status indicates whether each OPTNAME is set or unset. The -o option restricts the OPTNAMEs to those defined for use with `set -o'. With no options, or with the -p option, a list of all settable options is displayed, with an indication of whether or not each is set.
相關文章
相關標籤/搜索