歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> linux 使用幫助

linux 使用幫助

日期:2017/3/3 11:09:22   编辑:Linux技術

linux幫助使用

Linux下的命令繁多,參數復雜。使用的時候難免有忘記混淆或不熟悉的命令的時候。在Linux下使用幫助,是一項非常好的工作和學習能力。下面介紹Linux下使用幫助的方法。1. 方法一help/--help確定命令的類型命令分為內部命令和外部命令。

管理員使用計算機就要登錄計算機(這裡指命令界面下),等計算機,就要是用shell。內部命令知道就是這些命令是shell內嵌的命令。所以這些命令在命令提示符下直接輸入hellp + COMMAND即可查詢命令的幫助信息。

外部命令,不是shell內嵌的命令,是的單獨的應用程序。獲取幫助的方法是COMMAND --help(類似於windows圖形界面下的F1調出幫助頁面)。

確定命令是內部命令還是外部命令的命令是type

[root@centos6-mini ~]# type hashhash is a shell builtin
[root@centos6-mini ~]# type lsls is aliased to `ls --color=auto'[root@centos6-mini ~]# type ifconfigifconfig is hashed (/sbin/ifconfig)
[root@centos6-mini ~]# help cdcd: cd [-L|-P] [dir]
    Change the shell working directory.
    
    Change the current directory to DIR.  The default DIR is the value of the
    HOME shell variable.
    
    The variable CDPATH defines the search path for the directory containing
    DIR.  Alternative directory names in CDPATH are separated by a colon (:).
    A null directory name is the same as the current directory.  If DIR begins    with 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 symbolic
        links
    
    The default is to follow symbolic links, as if `-L' were specified.
    
    Exit Status:
    Returns 0 if the directory is changed; non-zero otherwise.
[root@centos6-mini ~]# ls --helpUsage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all                  do not ignore entries starting with .
  -A, --almost-all           do not list implied . and ..
      --author               with -l, print the author of each file
  -b, --escape               print octal escapes for nongraphic characters
      --block-size=SIZE      use SIZE-byte blocks.  See SIZE format below
方法2使用man

man工具介紹

man幫助文檔的分類** *8 System Administration tools and Deamons
注:不光是應用程序有幫助文件,設備文件、庫、文檔也有幫助文件。所以有些同名的文件、或程序。
man COMMANDman –a keyword 列出所有幫助

man -kkeyword列出所有匹配的頁面

使用whatis數據庫

man 章節號 COMMADN

man常用的用法

man內容格式
       SYNOPSIS摘要:
          []:          <>
          a|b
          ....同一內容可以出現多次
分為8個章節

2      System Calls 3      C Library Functions 4      Devices and Special Files 5      File Formats and Conventions 6      Games et. Al. 7      Miscellanea
方法3使用infoInfo 是什麼?info是一種文檔格式,也是閱讀此格式文檔的閱讀器;我們常用它來查看Linux命令的info文檔。它以主題的形式把幾個命令組織在一起,以便於我們閱讀;在主題內以node(節點)的形式把本主題的幾個命令串聯在一起。info查看幫助信息更詳細。man於info的區別分,但與man相比,info工具可顯示更完整的最新的GNU工具信息。若man頁包含的某個工具的概要信息在info中也有介紹,那麼man頁中會有 “請參考info頁更詳細內容”的字樣。通常情況下,man工具顯示的非GNU工具的信息是唯一的,而info工具顯示的非GNU工具的信息是man頁內 容的副本補充。
Menu下方就是本主題內的命令,敲M鍵,然後輸入命令的名稱就可以查看該命令的info幫助文檔了。

下面介紹一下它的幾個常用快捷鍵。
 敲?鍵,它就會顯示info的常用快捷鍵。
 N鍵:顯示(相對於本節點的)下一節點的文檔內容
 P鍵:顯示(相對於本節點的)前一節點的文檔內容
 U鍵:進入當前命令所在的主題
 M鍵:敲M鍵後輸入命令的名稱就可以查看該命令的幫助文檔了
 G鍵:敲G鍵後輸入主題名稱,進入該主題
 L鍵:回到上一個訪問的頁面
 SPACE鍵:向前滾動一頁
 BACKUP或DEL鍵:向後滾動一頁
 Q:退出info
 命令
 ?     顯示幫助窗口
        在幫助窗口中:
          Ctrl-x 0      關閉幫助窗口
          Ctrl-x Ctrl-c 關閉整個 Info
          
 q      退出 info
 n      打開與本 Node 關聯的下一個 Node
 p      打開與本 Node 關聯的前一個 Node
 u      打開與本 Node 關聯的上一個 Node
 l       回到上一次訪問的 Node
 m或g 選擇一個菜單項(Node 的名字)
        輸入指定菜單的名字後按回車,打開指定菜單項關聯的 Node
 空格鍵 下一頁(PageDown 也可以,下一頁從當前頁的最後兩行開始算起)
        下一個 Node (若當前頁在 Node 文檔的末尾)
 Del 鍵 上一頁(PageUp 也可以,上一頁從當前頁的開始兩行開始算起)
        上一個 Node (若當前頁 Node 文檔的開始)
        
 b 或 t 或 Home 文檔的開始(b 是 begining 的意思)
 e 或 End       文檔的末尾(b 是 ending 的意思)
 Ctrl-l  刷新當前頁,若當前文檔顯示情況有問題時
 Ctrl-g 取消所鍵入的指令
File: history.info,  Node: Top,  Next: Using History Interactively,  Up: (dir)GNU History Library*******************This document describes the GNU History library, a programming tool that
provides a consistent user interface for recalling lines of previously
typed input.* Menu:* Using History Interactively::   GNU History User's Manual.* Programming with GNU History::  GNU History Programmer's Manual.* GNU Free Documentation License::      License for copying this manual.* Concept Index::                 Index of concepts described in this manual.* Function and Variable Index::   Index of externally visible functions
                                  and variables.
可以看到history的info信息更詳細。

Copyright © Linux教程網 All Rights Reserved