Linux study notes - help commands

 

1.9.1.man

 

English: manual

Get help with a command or configuration file

 

View help information for the ls command

man ls

 

Command usage similar to the combination of more and less

 

Space: turn page

q : quit

Enter: scroll down line by line

Enter / and search content, press Enter to search

 

 

When viewing the configuration file help, you cannot use an absolute path, just enter the configuration file name directly.

 

View the help information of the configuration file yum.conf

man yum.conf

 

View help for passwd configuration file

[root@localhost ~]# which passwd

/usr/bin/passwd

[root@localhost ~]# whereis passwd

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

 

whereis shows that passwd is a command and a configuration file with the same name. At this time, using man passwd shows the help of the command, not the help of the configuration file.

passwd.1.gz stands for command help, 1 means command help, 5 means configuration file help , for example: passwd.5.gz

 

What if I want to view the configuration file help at this point? The following command

 

man 5 passwd

 

1.9.2.whatis

whatis View a brief description of a command and what it does.

 

[root@localhost ~]# whatis ls

ls (1)               - list directory contents

 

1.9.3.apropos

View a brief description of the configuration file, what does it do

[root@localhost ~]# apropos yum.conf

yum.conf (5)         - Configuration file for yum(8).

 

1.9.4.–help

 

command --help

Almost all commands have this option

 

[root@localhost ~]# whatis --help

Usage: whatis [OPTION...] KEYWORD...

 

  -d, --debug                emit debugging messages

  -v, --verbose              print verbose warning messages

  -r, --regex                interpret each keyword as a regex

  -w, --wildcard             the keyword(s) contain wildcards

  -l, --long                 do not trim output to terminal width

  -C, --config-file=FILE     use this user configuration file

  -L, --locale=LOCALE        define the locale for this search

  -m, --systems=SYSTEM       use manual pages from other systems

  -M, --manpath=PATH         set search path for manual pages to PATH

  -s, --sections=LIST, --section=LIST

                             search only these sections (colon-separated)

  -?, --help                 give this help list

      --usage                give a short usage message

  -V, --version              print program version

 

Mandatory or optional arguments to long options are also mandatory or optional

for any corresponding short options.

 

Report bugs to [email protected].

 

[root@localhost ~]#

 

1.9.5.info

It is also help information, similar to man, but in a different way.

1.9.6.help

How can I tell if it's a built-in command?

man cd

 

BASH_BUILTINS(1)                            General Commands Manual                            BASH_BUILTINS(1)

 

NAME

       bash,  :,  .,  [, alias, bg, bind, break, builtin, caller, cd, command, compgen, complete, compopt, con

       tinue, declare, dirs, disown, echo, enable, eval, exec, exit, export,  false,  fc,  fg,  getopts,  hash,

       help,  history,  jobs,  kill,  let,  local,  logout,  mapfile, popd, printf, pushd, pwd, read, readonly,

       return, set, shift, shopt, source, suspend, test, times, trap, true, type, typeset, ulimit, umask,  una

       lias, unset, wait - bash built-in commands, see bash(1)

 

 

View help information for the umask built-in command

[root@localhost ~]# help umask

umask: umask [-p] [-S] [mode]

    Display or set file mode mask.

 

    Sets the user file-creation mask to MODE.  If MODE is omitted, prints

    the current value of the mask.

 

    If MODE begins with a digit, it is interpreted as an octal number;

    otherwise it is a symbolic mode string like that accepted by chmod(1).

 

    Options:

      -p        if MODE is omitted, output in a form that may be reused as input

      -S        makes the output symbolic; otherwise an octal number is output

 

    Exit Status:

    Returns success unless MODE is invalid or an invalid option is given.

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326036068&siteId=291194637