Linux基础之Linux中的帮助

一、whatis

用法:whatis 命令A
查看命令A的用途
eg:
查看命令touch的用途:

[root@localhost Desktop]# whatis touch
touch (1)            - change file timestamps
touch (1p)           - change file access and modification times

在这里插入图片描述
注意:如果显示没有解释,则可通过mandb更新一下。

[root@localhost Desktop]# whatis command
command: nothing appropriate.
[root@localhost Desktop]# mandb

在这里插入图片描述
在这里插入图片描述

二、help

用法:命令A --help
查看命令A的基本用法
eg:
查看命令touch的基本用法:

[root@localhost Desktop]# touch --help
Usage: touch [OPTION]... FILE...
Update the access and modification times of each FILE to the current time.

A FILE argument that does not exist is created empty, unless -c or -h
is supplied.

A FILE argument string of - is handled specially and causes touch to
change the times of the file associated with standard output.

Mandatory arguments to long options are mandatory for short options too.
  -a                     change only the access time
  -c, --no-create        do not create any files
  -d, --date=STRING      parse STRING and use it instead of current time
  -f                     (ignored)
  -h, --no-dereference   affect each symbolic link instead of any referenced
                         file (useful only on systems that can change the
                         timestamps of a symlink)
  -m                     change only the modification time
  -r, --reference=FILE   use this file's times instead of current time
  -t STAMP               use [[CC]YY]MMDDhhmm[.ss] instead of current time
      --time=WORD        change the specified time:
                           WORD is access, atime, or use: equivalent to -a
                           WORD is modify or mtime: equivalent to -m
      --help     display this help and exit
      --version  output version information and exit

Note that the -d and -t options accept different time-date formats.

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation at: <https://www.gnu.org/software/coreutils/touch>
or available locally via: info '(coreutils) touch invocation'

在这里插入图片描述
其中:

显示 含义
[内容] 表示在执行时可加可不加的内容
表示加入的内容个数任意
<内容> 表示在执行操作时必须加入的

三、man

用法:man 级别 对象

1、man级别

1 :查看命令的帮助
2 : 查看可被系统调用的函数的帮助
3 : 查看函数调用的帮助
4 : 查看系统特殊文件的帮助
5 : 查看系统配置文件的帮助
6 : 查看游戏的帮助
7 : 查看特殊包的帮助
8 : 查看系统管理命令的帮助
9 : 查看和内核相关规则的帮助

2、man 命令

查看命令用法
eg:查看passwd命令用法

[root@localhost Desktop]# man passwd

在这里插入图片描述

3、man -k 命令

查看命令在系统中有多少个级别的man
eg:查看passwd在系统中有多少个级别的man

[root@localhost Desktop]# man -k passwd
passwd (1)           - update user's authentication tokens
passwd (5)           - password file

在这里插入图片描述
从结果可知,passwd总共有两个级别的man(1和5)。
eg:
man 5 passwd(5表示查看系统配置文件的帮助) ,即查看/etc/passwd文件

[root@localhost Desktop]# man 5 passwd

在这里插入图片描述

发布了15 篇原创文章 · 获赞 3 · 访问量 689

猜你喜欢

转载自blog.csdn.net/weixin_42006882/article/details/103808618