Linux MAN命令的使用技巧

系统 Linux
本文章主要介绍Linux MAN命令以及Linux MAN命令使用方法,可以使你更方便的运用Linux技术。

在Linux的shell下我经常要使用Linux man命令来查看一些不熟悉的命令的使用方法。最经在shell下编程的时候,发现一些c和c++中的库函数。不清楚,我都跑去网上搜索了。一不小心,我发现,原来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()的用法了。

【编辑推荐】

  1. Ubuntu IT行业挨踢还是盗版的问题
  2. Ubuntu openSUSE特性与包构建服务
  3. Ubuntu所需文件从硬盘引导DOS启动的方法
  4. 进军企业服务器 Ubuntu准备好了吗?
  5. Ubuntu安装系统核心镜像文件指向那下载的文件
责任编辑:志辉 来源: www.linuxidc.com
相关推荐

2009-12-03 10:07:55

Linuxman命令使用技巧

2010-03-05 15:20:25

Linux man命令

2013-12-26 16:55:56

manman命令

2024-03-18 11:24:54

2023-12-27 14:08:00

LinuxTop命令工具

2009-08-17 08:42:48

LinuxScreen命令使用技巧

2019-12-04 12:28:24

TOP命令Linux

2024-03-26 15:21:43

2009-10-22 16:00:37

Linux基本命令

2018-09-12 21:44:32

Linux命令行操作系统

2009-07-31 17:51:42

linux vi命令详linux vi命令编辑器

2011-03-23 16:49:17

LAMP技巧linux命令

2014-08-11 09:45:33

Linux小技巧

2010-03-11 09:50:46

Linux VI命令

2018-03-14 14:27:00

2017-03-13 08:50:35

科技新闻早报

2023-02-02 14:06:00

history命令技巧

2017-04-12 13:29:08

Linux命令行工具

2017-04-05 14:10:55

Linux命令行工具技巧

2017-03-27 14:40:01

Linux命令行工具技巧
点赞
收藏

51CTO技术栈公众号