man page

  1. man:查詢指令使用手冊。
    [dywang@mdk-dyw ~]$ man name
    參數說明:
    name: 要查詢的指令。
    
    #範例:查詢 cal(calendar) 指令用法。
    [dywang@mdk-dyw ~]$ man cal
    CAL(1)                    BSD General Commands Manual                   CAL(1)
    
    NAME
         cal - displays a calendar
    
    SYNOPSIS
         cal [-smjy13] [[month] year]
    
    DESCRIPTION
         Cal displays a simple calendar.  If arguments are not specified, the cur-
         rent month is displayed.  The options are as follows:
    
         -1      Display single month output.  (This is the default.)
    
         -3      Display prev/current/next month output.
    
         -s      Display Sunday as the first day of the week.  (This is the
                 default.)
    
         -m      Display Monday as the first day of the week.
    
         -j      Display Julian dates (days one-based, numbered from January 1).
    
    q     -y      Display a calendar for the current year.
    
         A single parameter specifies the year (1 - 9999) to be displayed; note
         the year must be fully specified: “cal 89” will not display a calendar
         for 1989.  Two parameters denote the month (1 - 12) and year.  If no
         parameters are specified, the current month's calendar is displayed.
    
         A year starts on Jan 1.
    
         The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd
         of September.  By this time, most countries had recognized the reforma-
         tion (although a few did not recognize it until the early 1900's.)  Ten
         days following that date were eliminated by the reformation, so the cal-
         endar for that month is a bit unusual.
    
    HISTORY
         A cal command appeared in Version 6 AT&T UNIX.
    
    OTHER VERSIONS
         Several much more elaborate versions of this program exist, with support
         for colors, holidays, birthdays, reminders and appointments, etc. For
         example, try the cal from http://home.sprynet.com/~cbagwell/projects.html
         or GNU gcal.
    
    BSD                              June 6, 1993                              BSD
    
  2. man 的相關檔案
    1. 設定檔 /etc/man.config
    2. 資料目錄 /usr/share/man
    3. 文件目錄 /usr/share/doc

  3. 數字代號
    代號 代表內容
    1 使用者可以操作的指令或可執行檔
    2 系統核心可呼叫的函式與工具
    3 常用函式 (function) 與函式庫 (library)
    4 裝置檔案的說明
    5 設定檔
    6 遊戲
    7 慣例與協定
    8 系統管理員可用的管理指令
    9 跟核心有關的文件
  4. 內容代號
    代號 代表內容
    NAME 簡短指令、資料名稱說明
    SYNOPSIS 簡短指令下達語法簡介
    DESCRIPTION 較完整的說明
    OPTIONS 針對 SYNOPSIS 中列舉的所有參數說明
    COMMANDS 當此程式執行中可下達的指令
    FILES 此程式所使用、參考或連結的檔案
    SEE ALSO 與此指令相關的說明
    EXAMPLE 參考範例
    BUGS 是否有相關的臭蟲
    HISTORY 指令歷史
    OTHER VERSIONS 是否有其他版本

  5. man 相關按鍵有:
    按鍵 進行工作
    空白鍵 往下翻一頁。
    page up 往上翻一頁。
    page down 往下翻一頁。
    home 回到最前頁。
    end 到最終頁。
    /word 向下搜尋 word 這個字。
    ?word 向上搜尋 word 這個字。
    n,N n 繼續下一個搜尋,N 繼續反向搜尋。
    q 離開。

  6. man 使用功能
    [root@mdk-dyw root]# man --help
    man, version 1.5m
    
    usage: man [-adfhktwW] [section] [-M path] [-P pager] [-S list]
            [-m system] [-p string] name ...
    
      a : find all matching entries
      c : do not use cat file
      d : print gobs of debugging information
      D : as for -d, but also display the pages
      f : same as whatis(1)
      h : print this help message
      k : same as apropos(1)
      K : search for a string in all pages
      t : use troff to format pages for printing
      w : print location of man page(s) that would be displayed
          (if no name given: print directories that would be searched)
      W : as for -w, but display filenames only
    
      C file   : use `file' as configuration file
      M path   : set search path for manual pages to `path'
      P pager  : use program `pager' to display pages
      S list   : colon separated section list
      m system : search for alternate system's man pages
      p string : string tells which preprocessors to run
                   e - [n]eqn(1)   p - pic(1)    t - tbl(1)
                   g - grap(1)     r - refer(1)  v - vgrind(1)
    

練習題

  1. 如何查閱 Linux 指令 ls 之使用手冊?
    Sol. man ls
  2. 以 man 查詢指令用法,第一行出現的數字代號 1 代表意義為何?
    Sol. 使用者可以操作的指令或可執行檔
  3. 以 man 查詢指令用法,第一行出現的數字代號 5 代表意義為何?
    Sol. 設定檔
  4. 以 man 查詢指令用法,第一行出現的數字代號 6 代表意義為何?
    Sol. 遊戲
  5. 以 man 查詢指令用法,第一行出現的數字代號 8 代表意義為何?
    Sol. 系統管理員可用的管理指令
  6. 以 man 查詢指令用法,第一行出現的數字代號 9 代表意義為何?
    Sol. 跟核心有關的文件
  7. 以 man 查詢指令用法,段落 NAME 內容為何?
    Sol. 簡短指令、資料名稱說明
  8. 以 man 查詢指令用法,段落 SYNOPSIS 內容為何?
    Sol. 簡短指令下達語法簡介
  9. 以 man 查詢指令用法,段落 DESCRIPTION 內容為何?
    Sol. 較完整的說明
  10. 以 man 查詢指令用法,段落 OPTIONS 內容為何?
    Sol. 針對 SYNOPSIS 中列舉的所有參數說明
  11. 以 man 查詢指令用法,段落 COMMANDS 內容為何?
    Sol. 當此程式執行中可下達的指令
  12. 以 man 查詢指令用法,段落 FILES 內容為何?
    Sol. 此程式所使用、參考或連結的檔案
  13. 以 man 查詢指令用法,段落 EXAMPLE 內容為何?
    Sol. 參考範例
  14. 以 man 查詢指令用法,段落 BUGS 內容為何?
    Sol. 是否有相關的臭蟲
  15. 以 man 查詢指令用法,段落 HISTORY 內容為何?
    Sol. 指令歷史
  16. 以 man 查詢指令用法,段落 OTHER VERSIONS 內容為何?
    Sol. 是否有其他版本
  17. 以 man 查詢指令用法,按下空白鍵進行之動作為何?
    Sol. 往下翻一頁。
  18. 以 man 查詢指令用法,按下空白鍵進行之動作為何?
    Sol. 往下翻一頁。
  19. 以 man 查詢指令用法,按下 page up 進行之動作為何?
    Sol. 往上翻一頁。
  20. 以 man 查詢指令用法,按下 page down 進行之動作為何?
    Sol. 往下翻一頁。
  21. 以 man 查詢指令用法,按下 home 進行之動作為何?
    Sol. 回到最前頁。
  22. 以 man 查詢指令用法,按下 end 進行之動作為何?
    Sol. 到最終頁。
  23. 以 man 查看指令手冊時,如何查詢字串 ABC ?(兩種方法)
    Sol. /ABC 或 ?ABC
  24. 以 man 查詢指令用法,如何從目前游標處向下搜尋 word 這個字?如何繼續向下搜尋?
    Sol. 1.輸入 /word。 2.輸入 n。
  25. 以 man 查詢指令用法,如何從目前游標處向下搜尋 word 這個字?如何繼續向上搜尋?
    Sol. 1.輸入 /word。 2.輸入 N。
  26. 以 man 查詢指令用法,如何從目前游標處向上搜尋 word 這個字?如何繼續向上搜尋?
    Sol. 輸入 ?word。 2.輸入 n。
  27. 以 man 查詢指令用法,如何從目前游標處向上搜尋 word 這個字?如何繼續向下搜尋?
    Sol. 輸入 ?word。 2.輸入 N。
  28. 以 man 查詢指令用法,如何離開目前的查詢?
    Sol. 輸入 q。
  29. 要如何顯示出家目錄下的隱藏檔?
    Sol. ls -a, ls -A (只要包含 -a 或 -A 選項即可)

  DYWANG_HOME