Linux中MAN命令怎么用

这篇文章主要为大家展示了“Linux中MAN命令怎么用”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux中MAN命令怎么用”这篇文章吧。

Linux man中的man就是manual的缩写,用来查看系统中自带的各种参考手册,但是手册页分为好几个部分,如下所示:

1   Executable programs or shell commands

2   System calls (functions provided by the kernel)

3   Library calls (functions within program libraries)

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]

在shell中输入 man+数字+命令/函数 即可以查到相关的命令和函数。若不加数字,那Linux man命令默认从数字较小的手册中寻找相关命令和函数。

例如,本来是想寻找c标准库中的rand()函数,直接使用man rand得到的是一个rand命令的手册,直接用来产生一个随机数,这个内容在手册section 1中。如果使用man 3 rand就可以得到自己想要的库函数中rand()的用法了。

以上是“Linux中MAN命令怎么用”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注行业资讯频道!