详细介绍Linux man命令的使用方法

系统 Linux
Linux man命令是使用Linux系统的人必须得掌握的一个命令,这个命令可以帮助你解决很多不知道使用方法的命令的使用。

Linux man命令是初学者必须要掌握的一个Linux重要命令,这个命令可以帮助在学习中遇到的各种不会使用的命令问题,每个命令的不同的使用方法都可以在这里查找的到。现在介绍具体使用方法。

在Linux的shell下我经常要使用man命令来查看一些不熟悉的命令的使用方法。最经在shell下编程的时候,发现一些c和c++中的库函数不清楚,我都跑去网上搜索了。一不小心,我发现,原来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+数字+命令/函数 即可以查到相关的命令和函数。若不加数字,那man命令默认从数字较小的手册中寻找相关命令和函数。

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

这就Linux man命令的使用技巧描述到这里。

【编辑推荐】

  1. 剖析Linux文件编码的查看及修改
  2. 解密一个Linux重要系统目录(一)
  3. 详细分析Linux服务器内存
  4. 详细介绍Linux shell脚本基础学习(一)
  5. Linux系统安全提高之安全配置
责任编辑:小霞 来源: 互联网
相关推荐

2010-03-08 17:04:17

Linux df命令

2010-03-04 11:07:24

Linux finge

2010-03-04 10:54:45

Linux telne

2010-03-09 09:55:14

Linux mount

2011-07-12 17:18:23

PHPstrtotime

2010-03-04 10:44:04

Linux ftp命令

2011-07-13 11:34:58

CC++时间函数

2009-08-11 09:26:06

2009-09-05 10:26:20

Linux压缩打包命令Linux命令

2022-02-26 08:39:09

LinuxScp命令

2009-08-04 08:32:06

Linux Find命Linux Find使用方法

2010-03-11 13:52:02

Linux MAN

2010-03-02 14:01:58

Linux硬件信息命令

2011-07-19 09:25:52

2012-05-11 10:13:54

2009-12-03 10:07:55

Linuxman命令使用技巧

2009-12-30 17:47:54

Ubuntu常用命令

2022-10-08 09:17:15

Linuxinxi

2012-05-09 10:52:37

Linux监控命令
点赞
收藏

51CTO技术栈公众号