info
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了info相关的知识,希望对你有一定的参考价值。
info
【功能说明】:
info - read Info documents #阅读Info文档
info是一种文档格式,也是阅读此格式文档的阅读器,我们通常用它来查看Linux命令的info文档,它以主题的形式把几个命令组织在一起,以便于我们阅读,在主题内以node<节点>的形式把本主题的几个命令串联在一起;info 适用于查询外部命令的帮助信息。
【语法格式】:
info [OPTION]... [MENU-ITEM...]
info [选项] ...[菜单项]
[[email protected] ~]# info write File: libc.info, Node: File StatusFlags, Next: FileLocks, Prev: DescriptorFlags, Up: Low-Level I/O 13.14 File Status Flags File 这个解释页面来自于文档libc.info Node 本节点的名称 File Status Flags Next 下一节点的名称 File Locks Prev 前一节点的名称 Descriptor Flags Up 上一节点的名称 Low-Level I/O
【选项参数】:
选项 | 说明 |
-w,--where,--location | 打印info文件在系统中的位置 |
-k,--apropos=string | 在所有手册的索引中查找string,模糊查询 |
-f,--file=FILENAME | 指定想浏览的info文件 |
-h,--help | 显示info帮助信息并退出 |
-o,output=FILENAME | 将选中的节点全输出至FILENAME |
【实践操作】:
1、-w,--where,--location 参数实例
[[email protected] ~]# info-w ls /usr/share/info/coreutils.info.gz
2、-k,--apropos=string 参数实例
[[email protected] ~]# info -k ls "(tar)Attributes" -- acls "(tar)Attributes" -- no-acls "(tar)verbose" -- totals "(tar)Option Summary" -- totals, summary "(tar)warnings" -- filename-with-nuls …… "(ld)VERSION" -- versions of symbols "(ld)Options" -- warnings, on combiningsymbols "(ld)Options" -- warnings, on undefinedsymbols "(ld)WIN32" -- weak externals "(bash)Conditional Constructs" -- else "(grep)Environment Variables" -- NLS "(sed)Programming Commands" -- Labels,in scripts
3、-f,--file=FILENAME 参数实例
[[email protected] ~]# info -f libc.info.gz File: libc.info, Node: Top, Next:Introduction, Prev: (dir), Up: (dir) Main Menu ********* This is Edition 0.12, last updated 2007-10-27, of`The GNU C Library Reference Manual‘, for Version 2.8 of the GNU CLibrary. * Menu: * Introduction:: Purpose of the GNU C Library. * Error Reporting:: How library functions reporterrors. * Memory:: Allocating virtualmemory and controlling paging. * Character Handling:: Character testing and conversionfunctions. * String and Array Utilities:: Utilities for copying and comparing strings and arrays. * Character Set Handling:: Support for extended character sets. * Locales:: The country and languagecan affect the behavior oflibrary functions. * Message Translation:: How to make the program speak theuser‘s language. * Searching and Sorting:: General searching and sortingfunctions. * Pattern Matching:: Matching shell ``globs‘‘ andregular expressions. * I/O Overview:: Introduction to the I/Ofacilities. * I/O on Streams:: High-level, portable I/Ofacilities. * Low-Level I/O:: Low-level, less portable I/O. * File System Interface:: Functions for manipulating files. * Pipes and FIFOs:: A simple interprocesscommunication --zz-Info: (libc.info.gz)Top, 1291 lines --Top--Subfile:libc.info-1.gz----------------------------------------------------------------------------------------------- Welcome to Info version 4.13. Type h for help, m formenu item.
4、-h,--help 参数实例
[[email protected] ~]# info -h Usage: info [OPTION]... [MENU-ITEM...] Read documentation in Info format. Options: -k,--apropos=STRING look up STRINGin all indices of all manuals. -d,--directory=DIR add DIR toINFOPATH. --dribble=FILENAME rememberuser keystrokes in FILENAME. -f,--file=FILENAME specify Infofile to visit. -h,--help display thishelp and exit. --index-search=STRING go tonode pointed by index entry STRING. -n,--node=NODENAME specify nodes infirst visited Info file. -o,--output=FILENAME output selectednodes to FILENAME. -R,--raw-escapes output"raw" ANSI escapes (default). --no-raw-escapes output escapes as literal text. --restore=FILENAME readinitial keystrokes from FILENAME. -O,--show-options, --usage go tocommand-line options node. --subnodes recursively output menu items. --vi-keys use vi-like and less-like key bindings. --version displayversion information and exit. -w,--where, --location print physicallocation of Info file. The first non-option argument, if present, is themenu entry to start from; it is searched for in all `dir‘ files alongINFOPATH. If it is not present, info merges all `dir‘ filesand shows the result. Any remaining arguments are treated as the namesof menu items relative to the initial node visited. For a summary of key bindings, type h within Info. Examples: info show top-level dir menu infoinfo show the generalmanual for Info readers infoinfo-stnd show the manualspecific to this Info program infoemacs start at emacs node from top-leveldir info emacsbuffers start at buffers nodewithin emacs manual info--show-options emacs start at node withemacs‘ command line options info--subnodes -o out.txt emacs dump entiremanual to out.txt info -f./foo.info show file ./foo.info,not searching dir Email bug reports to [email protected], general questions and discussion [email protected] Texinfo home page: http://www.gnu.org/software/texinfo/
5、-o,output=FILENAME 参数实例
[[email protected] ~]# ll total 36 -rw-------. 1 root root 1063 Oct 25 21:58 anaconda-ks.cfg -rw-r--r--. 1 root root 21682 Oct 25 21:58install.log -rw-r--r--. 1 root root 5890 Oct 25 21:57 install.log.syslog [[email protected] ~]# info -o out.txt ls info: Writing node (coreutils.info.gz)lsinvocation... info: Done. [[email protected] ~]# ll -h total 40K -rw-------. 1 root root 1.1K Oct 25 21:58anaconda-ks.cfg -rw-r--r--. 1 root root 22K Oct 25 21:58 install.log -rw-r--r--. 1 root root 5.8K Oct 25 21:57install.log.syslog -rw-r--r--. 1 root root 2.3K Feb 24 11:13 out.txt
【技巧拓展】:
1、info 文档存放目录
/usr/share/info
2、info快捷键
?键 显示info的常用快捷键 N键 显示(相对于本节点的)下一节点的文档内容 P键 显示(相对于本节点的)前一节点的文档内容 U键 进入当前命令所在的主题 M键 敲M键后输入命令的名称就可以查看该命令的帮助文档了 G键 敲G键后输入主题名称,进入该主题 L键 回到上一个访问的页面 SPACE键 向前滚动一页 BACKSPACE或DEL键 向后滚动一页 q 退出info Basic Info command keys x Close this help window. #关闭帮助窗口 q Quit Info altogether. #完全退出信息 H Invoke the Info tutorial. #调用info教程 Up Move up one line. #向上移动一行 Down Move down one line. #向下移动一行 DEL Scroll backward one screenful. #向后滚动一屏 SPC Scroll forward one screenful. #向前滚动一屏 Home Go to the beginning of this node. #转到此节点的开头 End Go to the end of this node. #转到此节点的结尾 TAB Skip to the next hypertext link. #跳到下一个超文本链接 RET Follow the hypertext link under the cursor. #按照光标下的超文本链接 l Go back to the last node seen in this window. #返回到此窗口中看到的最后一个节点 [ Go to the previous node in the document. #转到文档中的上一个节点 ] Go to the next node in the document. #转到文档中的下一个节点 p Go to the previous node on this level. #转到此级别上的上一个节点 n Go to the next node on this level. #转到此级别上的下一个节点 u Go up one level. #上一层 t Go to the top node of this document. #转到本文档的顶层节点 d Go to the main `directory‘ node. #转到主“目录”节点 1...9 Pick the first...ninth item in thisnode‘s menu. #选择此节点菜单中的第1个...第9个项目 0 Pick the last item in this node‘s menu. #选择此节点菜单中的最后一项 m Pick a menu item specified by name. #选择由名称指定的菜单项 r Follow a cross reference specified by name. #按照名称指定的交叉引用 g Go to a node specified by name. #转到由name指定的节点 s Search forward for a specified string. #向前搜索指定的字符串 { Search for previous occurrence. #搜索上一次出现 } Search for next occurrence. #搜索下一个事件 i Search for a specified string in the index, and select the node referenced by thefirst entry found. #在索引中搜索指定的字符串,并且选择由找到的第一个条目引用的节点 C-g Cancel the current operation. #取消当前操作 --------------------- The current search path is: /usr/share/info:.:/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info ---------------------
本文出自 “Marin” 博客,请务必保留此出处http://marin.blog.51cto.com/11904838/1906189
以上是关于info的主要内容,如果未能解决你的问题,请参考以下文章