探索這個“男人”

一、前言

正所謂了解一個命令就得了解他的用法,正好是要了解一個人就得了解他的興趣愛好,處事態度以及為人是怎么樣的。

二、man是什么

man – an interface to the on-line reference manuals

Manmanual(手冊)的縮寫,使用權限是所有用戶,man命令提供為linux系統在線提供了很好的幫助手冊,幾乎可以說不懂就問問這個“男人”吧。

三、man都有哪些呢

 man 既然是手冊,那COMMAND一定也會有會有手冊,這時候就可以看man的手冊如圖3-1

   

圖片1.png

                            圖3-1man的描述

DESCRIPTION(描述)

        man 是一個系統幫助手冊,每頁都是不同的參數

       man is the system's manual pager. Each page argument given to man is normally

       the name of a program, utility or function.  The manual page  associated  with

       each of  these arguments is then found and displayed. A section, if provided,

       will direct man to look only in that  section  of  the  manual.   The  default

       action  is to search in all of the available sections, following a pre-defined

       order and to show only the first page found, even if page  exists  in  several

       sections.

      man是一個系統幫助手冊,man有著不同章節,每個頁面章節是man 的項目的名稱,

     實用程序或功能,這些參數相關的手冊頁發現并顯示,如果提供手冊頁的章節會把那       章節的內容輸出,默認的查找是在所有可用的搜索結果,按照預定義的順序只顯示第     一個手冊頁,即使還有其他手冊頁。

 

相關的手冊頁有;

       1   Executable programs or shell commands

           用戶命令

       2   System calls (functions provided by the kernel)

           系統調用

       3   Library calls (functions within program libraries)

           C庫調用

       4   Special files (usually found in /dev)

           設備文件及特殊文件

       5   File formats and conventions eg /etc/passwd

           配置文件格式

       6   Games

           游戲

       7   Miscellaneous (including macro packages  and  conventions),  e.g.  man(7),

           groff(7)

           雜項

       8   System administration commands (usually only for root)

          管理類的命令

       9   Kernel routines [Non standard]

          內核常規(非標準)

注意:有些關鍵字在不止一個章節中存在幫助:

     要查看指定章節中的手冊:man#COMMAND   (#代表數字)

 四、man的查看方式

Man的有哪些頁已經知道,當然還得知道怎么樣查看和翻閱。

man命令的操作方法既less:

 Space,ctrl+v,ctrl+f,ctrl+F,:向文件尾部翻屏:

  b,ctrl+B:向文件首部翻屏:

 d,ctrl+D:向文件尾部翻半屏:

 u,ctrl+U:向文件首部翻半屏:

 RETURN or ctrl+N, e ,ctrl+E, j, ctrl+J:向文件尾部翻一行:

y,ctrl+Y,ctrl+P,k,ctrl+K: 向文件首部翻一行

 q:退出

 #:跳轉至第#行:

1G:回到文件首部

 G:翻至文件尾部

 文本搜索:

 /KEYWORD:

以KEYWORD指定的字符串為關鍵字,從當前位置向文件首部搜索:不區分字符大小寫:

              n:跟搜索命令同方向,下一個

              N:跟搜索命令反方向,上一個

五、man的路徑

     Man的查看和翻閱知道了  那就的知道man 的命令是在那里,     man命令的路徑在那

                [root@localhost etc]# whereis man

            man: /usr/bin/man /usr/share/man /usr/share/man/man1/man.1.gz

 

六、man 的用法

  了解了什么是man,當然得了解man都有哪些用法。

探索這個“男人”

                  圖5-1 man的用法

Man有很多選項:

       Non argument options that are  duplicated  either  on  the  command  line,  in$MANOPT, or both, are not harmful.  For options that require an argument, each

       duplication will override the previous argument value.

非參數選項在命令行中復制$MANOPT,或者兩者都有,并不是所有的選項需要參數,每個重復參數將覆蓋前面的參數值。

以下是man運用的例子

探索這個“男人”

                            圖5-2 man的例子

EXAMPLES

       man ls

Display the manual page for the item (program) ls.

顯示項目手冊頁或程序 ls

       man -a intro

     Display, in succession, all of the available intro manual pages contained within the manual.  It is possible to quit between successive displays or skip any of them.

    顯示,連續,所有可用的介紹手冊頁中包含的手冊。可以退出之間連續顯示或跳過其中任何一個。

 

       man -t alias | lpr -Pps

           Format  the manual page referenced by `alias', usually a shell manual page, into the default troff or groff format and pipe it to the printer named ps.  The default output for

           groff is usually PostScript.  man –help should advise as to which processor is bound to the -t option.

       格式手冊頁面引用的別名”,通常是一個shell手冊頁面,默認troffgroff格式和管輸出叫psgroff的默認輸出通常是PostScript。man——幫助應該建議哪些處理器綁定到– t選項。

       man -l -Tdvi ./foo.1x.gz > ./foo.1x.dvi

           This command will decompress and format the nroff source manual page ./foo.1x.gz into a device independent (dvi) file.  The redirection is necessary as the -T flag causes out?

           put to be directed to stdout with no pager.  The output could be viewed with a program such as xdvi or further processed into PostScript using a program such as dvips.

這個命令是解壓和使用 groff 的指定設備, ./foo.1x.gz 是一個設備獨立文件,重定向是必要的

         輸出可以與xdvi等程序或進一步加工成PostScript使用dvips等程序。

 

       man -k printf

           Search the short descriptions and manual page names for the keyword printf as regular expression.  Print out any matches.  Equivalent to apropos -r printf.

. 使用帶有-k選項的man命令可以根據關鍵字搜索聯機幫助。如查找printf

       man -f string

    Lookup the manual pages referenced by smail and print out the short descriptions of any found.  Equivalent to whatis -r smail.

      查找命令頁中被引用的信息string 輸出,短的說明,man -f  等同于 whatis -r smile


    七、命令總結

       想要使用或不知道某個命令,man可以幫助你,man有多個手冊頁,你想知道這個命令有哪些手冊頁可使用man -k COMMAND。

   然后你就可以在有的手冊頁上查看,想到那個手冊頁可使用  man #  COMMAND   #代表數字。還有…


 

原創文章,作者:N19_king,如若轉載,請注明出處:http://www.www58058.com/15831

(0)
N19_kingN19_king
上一篇 2016-05-03
下一篇 2016-05-04

相關推薦

  • Linux程序包管理(二)YUM使用

    YUM Linux程序包管理(二) 說完了程序包管理以及rpm的相關使用,接下來說說rpm的前端管理工具 YUM YUM是什么?    前面提到,yum是rpm程序包管理器的前端管理工具,那么yum到底是什么?又能做什么呢? YUM:yellow dog,Yellowdog Update Mod…

    Linux干貨 2016-06-01
  • N25期–第八周作業

    1、寫一個腳本,使用ping命令探測172.16.250.1-172.16.250.254之間的所有主機的在線狀態; 在線的主機使用綠色顯示; 不在線的主使用紅色顯示; #!/bin/bash declare -i i=1 hostping(){     if ping -W&n…

    Linux干貨 2017-02-27
  • Linux Cluster之LVS

    一、Linux Cluster 基礎: Cluster:計算機集合為解決某個特定問題組合起來形成的單個系統 Linux Cluster類型: LB(Load Banlancing):負載均衡 HA(High Availability):高可用。提高服務可用性,避免出現單點故障 HP(High Performance):高性能 可用性衡量公式: A=MTBF/…

    2016-11-02
  • 了解Nginx

    Nginx Nginx是一款輕量級的Web 服務器/反向代理服務器及電子郵件(IMAP/POP3)代理服務器,并在一個BSD-like 協議下發行。由俄羅斯的程序設計師Igor Sysoev所開發,其特點是占有內存少,并發能力強,事實上nginx的并發能力確實在同類型的網頁服務器中表現較好,中國大陸使用nginx網站用戶有:百度、京東、新浪、網易、騰訊、淘寶…

    Linux干貨 2016-11-07
  • OpenSSL

    一、什么是OpenSSL 在電腦網絡上,OpenSSL是一個開放源代碼的軟件庫包,應用程序可以使用這個包來進行安全通訊,避免竊聽,同時確認另一端連接者的身份。這個包廣泛被應用在互聯網的網頁服務器上。其主要庫是以C語言所寫成,實現了基本的加密功能,實現了SSL與TLS協議。 OpenSSL由三部分組成:     libencryp…

    Linux干貨 2016-04-25
  • CentOS 7, lamp (php-fpm);(Blog 15)

    要求:
    (1) 三者分離于三臺主機;
    (2) 一個虛擬主機用于提供phpMyAdmin;另一個虛擬主機用于提供wordpress;
    (3) xcache

    2017-12-20
欧美性久久久久