歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> 詳解Linux系統中查詢文檔的man和info命令

詳解Linux系統中查詢文檔的man和info命令

日期:2017/3/1 17:31:05   编辑:Linux技術

man
Usage: man [OPTION...] [章節] 手冊頁...

-C, --config-file=文件 使用該用戶設置文件
-d, --debug 輸出調試信息
-D, --default 將所有選項都重置為默認值
--warnings[=警告] 開啟 groff 的警告

主要運行模式:
-f, --whatis 等同於 whatis
-k, --apropos 等同於 apropos
-K, --global-apropos search for text in all pages
-l, --local-file
把“手冊頁”參數當成本地文件名來解讀
-w, --where, --path, --location
輸出手冊頁的物理位置
-W, --where-cat, --location-cat
輸出 cat 文件的物理位置

-c, --catman 由 catman 使用,用來對過時的 cat
頁重新排版
-R, --recode=編碼 output source page encoded in ENCODING

尋找手冊頁:
-L, --locale=區域
定義本次手冊頁搜索所采用的區域設置
-m, --systems=系統 use manual pages from other systems
-M, --manpath=路徑 設置搜索手冊頁的路徑為“路徑”

-S, -s, --sections=列表 使用以半角冒號分隔的章節列表

-e, --extension=擴展
將搜索限制在擴展類型為“擴展”的手冊頁之內

-i, --ignore-case 查找手冊頁時不區分大小寫字母
(默認)
-I, --match-case 查找手冊頁時區分大小寫字母。

--regex show all pages matching regex
--wildcard show all pages matching wildcard

--names-only make --regex and --wildcard match page names only,
not descriptions

-a, --all 尋找所有匹配的手冊頁
-u, --update 強制進行緩存一致性的檢查

--no-subpages don't try subpages, e.g. 'man foo bar' => 'man
foo-bar'

控制格式化的輸出:
-P, --pager=PAGER 使用 PAGER 程序顯示輸出文本
-r, --prompt=字符串 給 less pager 提供一個提示行

-7, --ascii 顯示某些 latin1 字符的 ASCII 翻譯形式
-E, --encoding=編碼 use selected output encoding
--no-hyphenation, --nh turn off hyphenation
--no-justification, --nj turn off justification
-p, --preprocessor=字符串 字符串表示要運行哪些預處理器:
e - [n]eqn, p - pic, t - tbl,
g - grap, r - refer, v - vgrind

-t, --troff 使用 groff 對手冊頁排版
-T, --troff-device[=設備] 使用 groff 的指定設備

-H, --html[=浏覽器] 使用 www-browser 或指定浏覽器顯示 HTML
輸出
-X, --gxditview[=分辨率] 使用 groff 並通過 gxditview (X11)
來顯示:
-X = -TX75, -X100 = -TX100, -X100-12 = -TX100-12
-Z, --ditroff 使用 groff 並強制它生成 ditroff

-?, --help give this help list
--usage give a short usage message
-V, --version print program version

例:

復制代碼代碼如下:
[root@linux ~]# man ifconfig #查看ifconfig手冊

info
用法: info [OPTION]... [MENU-ITEM...]

以 Info 格式閱讀文檔。

選項:
-k, --apropos=STRING 在所有手冊頁的索引中查找 STRING。
-d, --directory=DIR 將 DIR 添加至 INFOPATH。
--dribble=FILENAME 將用戶的擊鍵條目在 FILENAME 中。
-f, --file=FILENAME 指定想浏覽的 Info 文件。
-h, --help 顯示此幫助並退出。
--index-search=STRING 跳轉至索引條目 STRING 所指的節點。
-n, --node=NODENAME 在首個浏覽過的 Info 文件中指定節點。
-o, --output=FILENAME 將選中的節點全輸出至 FILENAME。
-R, --raw-escapes 輸出“原始”的 ANSI 轉義符(默認)。
--no-raw-escapes 將轉義符輸出為普通文本。
--restore=FILENAME 從 FILENAME 中讀取初始擊鍵條目。
-O, --show-options, --usage 跳轉至命令行選項節點。
--subnodes 遞歸輸出菜單項。
--vi-keys 使用類似於 vi 和 less 的按鍵綁定。
--version 顯示版本信息並退出。
-w, --where, --location 打印 Info 文件在系統中的位置。

如果存在第一個非選項參數,它將是個用於起始的菜單條目;
所有在 INFOPATH 變量後跟著的“dir”文件都會搜索此條目。
如果不存在此參數,info 合並所有“dir”文件並顯示結果。
任何後續參數都被認為是與初始浏覽
節點有關的菜單項名稱。

在幫助信息中按 h 獲取有關按鍵綁定的內容。

范例:
info 顯示頂級目錄菜單
info info 顯示 Info readers 的普通手冊
info info-stnd 顯示此 Info 程序特定手冊
info emacs 從頂級目錄浏覽 emacs 節點
info emacs buffers 在 emacs 手冊頁中浏覽 buffers 節點
info --show-options emacs 浏覽與 emacs 的命令行選項有關的節點
info --subnodes -o out.txt emacs 將整個手冊頁輸出至 out.txt
info -f ./foo.info 顯示文件 ./foo.info,而不是查找目錄

例:

復制代碼代碼如下:
[root@linux ~]# info ifconfig #查看ifconfig手冊

Copyright © Linux教程網 All Rights Reserved