1. 程式人生 > >linux查看命令幫助的方法

linux查看命令幫助的方法

命令幫助

1.使用man命令查看
栗子:

 [root@Alibaba ~]# man cd

執行man命後的幫助信息簡介:

幫助標題 功能說明
NAME 命令說明及介紹
SYNOPSIS 基本使用語法
DESCRIPTION 參數選項說明

man幫助頁面快捷鍵

快捷鍵 功能說明
/string 向下搜索string字符串
?string 向上搜索string字符串
n,N 當使用"/"或"?"搜索 字符串時,n繼續按相同方向查詢,N則按照反向查詢。例子:/string 向下查找string,輸入n則繼續向下查找string,輸入N則向上查找string。?string向上查找string,輸入n則繼續向上查找,輸入N則向下查找string
q 結束本次man幫助

3.2.使用--help參數查看

使用"命令 --help"可以查看簡短的命令幫助信息。

[root@Alibaba ~]# mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask
  -p, --parents     no error if existing, make parent directories as needed
  -v, --verbose     print a message for each created directory
  -Z, --context=CTX  set the SELinux security context of each created

3.使用help命令查看bash內置命令
help命令只能查看bash內置的命令。

[root@Alibaba ~]# help cd
cd: cd [-L|-P] [dir]
    Change the shell working directory.

linux查看命令幫助的方法