linux常用協助命令man、whatis、apropos、--help、help+命令,whatisapropos

來源:互聯網
上載者:User

linux常用協助命令man、whatis、apropos、--help、help+命令,whatisapropos
Linux協助命令

man命令在內部是使用more來查看協助檔案的,所以可以使用more命令的一些快速鍵
當命令和設定檔名相同時,可以通過man 1 passwd查看命令協助,man 5 passwd查看設定檔協助

兩種協助檔案(命令和設定檔相同時)
1.命令的協助
5.設定檔的協助

一、man查看命令協助在man閱讀命令資訊下按/輸入搜尋內容可以在當前文本中尋找,同時按n跳轉到下一個尋找到的內容

二、man查看設定檔協助

不能以絕對路徑查看,否則是列印檔案內容

man 設定檔名

三、其他相關命令3.1、whatis只查看命令簡短協助文檔資訊
[root@localhost ~]# whatis ifconfigifconfig (8)         - 配置網路介面
3.2、apropos只查看設定檔簡短協助文檔資訊
[root@localhost ~]# apropos ifconfigifconfig (8)         - 配置網路介面ifcfg (8)            - simplistic script which replaces ifconfig IP managementpifconfig (8)        - display information about a network interface
3.3、命令後加–help查看常見的命令選項資訊
[root@localhost ~]# ls --help用法:ls [選項]... [檔案]...List information about the FILEs (the current directory by default).Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.Mandatory arguments to long options are mandatory for short options too.  -a, --all         不隱藏任何以. 開始的項目  -A, --almost-all      列出除. 及.. 以外的任何項目      --author          與-l 同時使用時列出每個檔案的作者  -b, --escape          以八進位溢出序列表示不可列印的字元      --block-size=SIZE      scale sizes by SIZE before printing them; e.g.,                               '--block-size=M' prints sizes in units of                               1,048,576 bytes; see SIZE format below  -B, --ignore-backups       do not list implied entries ending with ~  -c                         with -lt: sort by, and show, ctime (time of last                               modification of file status information);                               with -l: show ctime and sort by name;                               otherwise: sort by ctime, newest first  -C                         list entries by columns      --color[=WHEN]         colorize the output; WHEN can be 'never', 'auto',                               or 'always' (the default); more info below  -d, --directory            list directories themselves, not their contents  -D, --dired                generate output designed for Emacs' dired mode  -f                         do not sort, enable -aU, disable -ls --color  -F, --classify             append indicator (one of */=>@|) to entries      --file-type            likewise, except do not append '*'      --format=WORD          across -x, commas -m, horizontal -x, long -l,                               single-column -1, verbose -l, vertical -C      --full-time            like -l --time-style=full-iso  -g                類似-l,但不列出所有者      --group-directories-first                             group directories before files;                               can be augmented with a --sort option, but any                               use of --sort=none (-U) disables grouping  -G, --no-group        以一個長列表的形式,不輸出組名  -h, --human-readable      與-l 一起,以易於閱讀的格式輸出檔案大小                (例如 1K 234M 2G)      --si          同上面類似,但是使用1000 為基底而非1024  -H, --dereference-command-line                             follow symbolic links listed on the command line      --dereference-command-line-symlink-to-dir                             follow each command line symbolic link                               that points to a directory      --hide=PATTERN         do not list implied entries matching shell PATTERN                               (overridden by -a or -A)      --indicator-style=WORD  append indicator with style WORD to entry names:                               none (default), slash (-p),                               file-type (--file-type), classify (-F)  -i, --inode                print the index number of each file  -I, --ignore=PATTERN       do not list implied entries matching shell PATTERN  -k, --kibibytes            default to 1024-byte blocks for disk usage  -l                使用較長格式列出資訊  -L, --dereference     當顯示符號連結的檔案資訊時,顯示符號連結所指示                的對象而並非符號連結本身的資訊  -m                所有項目以逗號分隔,並填滿整行行寬  -n, --numeric-uid-gid     類似 -l,但列出UID 及G識別碼  -N, --literal         輸出未經處理的項目名稱 (如不特別處理控制字元)  -o                類似 -l,但不列出有關組的資訊  -p,  --indicator-style=slash  對目錄加上表示符號"/"  -q, --hide-control-chars   print ? instead of nongraphic characters      --show-control-chars   show nongraphic characters as-is (the default,                               unless program is 'ls' and output is a terminal)  -Q, --quote-name           enclose entry names in double quotes      --quoting-style=WORD   use quoting style WORD for entry names:                               literal, locale, shell, shell-always, c, escape  -r, --reverse         逆序排列  -R, --recursive       遞迴顯示子目錄  -s, --size            以塊數形式顯示每個檔案分配的尺寸  -S                         sort by file size      --sort=WORD            sort by WORD instead of name: none (-U), size (-S),                               time (-t), version (-v), extension (-X)      --time=WORD            with -l, show time as WORD instead of default                               modification time: atime or access or use (-u)                               ctime or status (-c); also use specified time                               as sort key if --sort=time      --time-style=STYLE     with -l, show times using style STYLE:                               full-iso, long-iso, iso, locale, or +FORMAT;                               FORMAT is interpreted like in 'date'; if FORMAT                               is FORMAT1FORMAT2, then FORMAT1 applies                               to non-recent files and FORMAT2 to recent files;                               if STYLE is prefixed with 'posix-', STYLE                               takes effect only outside the POSIX locale  -t                         sort by modification time, newest first  -T, --tabsize=COLS         assume tab stops at each COLS instead of 8  -u                         with -lt: sort by, and show, access time;                               with -l: show access time and sort by name;                               otherwise: sort by access time  -U                         do not sort; list entries in directory order  -v                         natural sort of (version) numbers within text  -w, --width=COLS           assume screen width instead of current value  -x                         list entries by lines instead of by columns  -X                         sort alphabetically by entry extension  -1                         list one file per lineSELinux options:  --lcontext                 Display security context.   Enable -l. Lines                             will probably be too wide for most displays.  -Z, --context              Display security context so it fits on most                             displays.  Displays only mode, user, group,                             security context and file name.  --scontext                 Display only security context and file name.      --help        顯示此協助資訊並退出      --version     顯示版本資訊並退出SIZE is an integer and optional unit (example: 10M is 10*1024*1024).  Unitsare K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (powers of 1000).
3.4、help+命令 查看Shell內建命令

查不到命令路徑的都是Shell內建命令

[root@localhost temp]# help umaskumask: umask [-p] [-S] [模式]    顯示或設定檔案模式掩碼。    設定使用者檔案建立掩碼為 MODE 模式。如果省略了 MODE,則    列印當前掩碼的值。    如果MODE 模式以數字開頭,則被當作八位元解析;否則是一個    chmod(1) 可接收的符號模式串。    選項:      -p    如果省略 MDOE 模式,以可重用為輸入的格式輸入      -S    以符號形式輸出,否則以八位元格式輸出    退出狀態:    返回成功,除非使用了無效的 MODE 模式或者選項。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.