Linux命令03:man

简介:

man命令是Linux在线参考手册的接口命令,所有的Linux命令都有参考手册,虽然是英文的,但耐心认真的读参考手册,可以学到无穷的知识,也可以解决Linux的大部分问题。

手册分类

最常用的是1用户命令,3(p)库函数,7惯例和协议。

分类号 内容
1 User Commands
2 System Calls
3 C Library Functions
4 Devices and Special Files
5 File Formats and Conventions
6 Games et. Al.
7 Miscellanea
8 System Administration tools and Deamons
p POSIX Programmer’s Manual

关于Linux Programmer’s Manual和POSIX Programmer’s Manual的区别,也就是如33p的区别,见

Basically, the linux manuals are documentation of the commands/APIs from their writers; The POSIX manuals are from the POSIX standard. Usually, the “normal” ones are shorter and terser, but deal with the specific implementation; the POSIX ones are longer and more detailed (see man 3p read), but only tell what is in the standard.

The best is to look in both.

常用参数

-f:按照完整全名查找手册。其实,是调用whatis命令,用完整名查询whatis数据库。
-k:查询匹配的手册。其实,是调用apropos命令,用字符串匹配whatis数据库。
nono就是分类号码。直接进入命令的对应分类手册。

举个栗子

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$ man -f man # 查询man的手册分类
man (7) - macros to format man pages
man (1) - an interface to the on-line reference manuals
man (1p) - display system documentation

$ man man # 进入man命令的参考手册 默认进入分类1

$ man 7 man # 进入man的分类7的手册

$ man -k printf # 查询所有包含printf字符串的手册
asprintf (3) - print to allocated string
dprintf (3) - print to a file descriptor
fprintf (3) - formatted output conversion
fprintf (3p) - print formatted output
fwprintf (3) - formatted wide-character output conversion
fwprintf (3p) - print formatted wide-character output
ldns_buffer_printf (3) - (unknown subject)
printf (1) - format and print data
printf (1p) - write formatted output
printf (3) - formatted output conversion
printf (3p) - print formatted output
...... # 省略了中间内容
wprintf (3p) - print formatted wide-character output

操作按键

按键 功能
j 向下
k 向上
space 下翻页
PgUp/u 上翻页
PgDn/d 下翻页
Home/gg 第一页
End/G 最后一页
/string 向下查找string
?string 向上查找string
n 下一个
N 上一个
q 退出
no 跳转到no行

其他

注意man命令其实是调用的less命令显示whatis数据库的内容,所以man的按键和less的按键是一样的,而less的命令和vim阅读模式的光标移动的按键是一样的。学了vim后,所有按键都会统一。
CentOS6.6的/etc/man.confman的配置文档,MANSECT参数可以设置显示分类的顺序。
CentOS7对应的是/etc/man_db.conf,参数是SECTION

~~ EOF ~~

目录
相关文章
|
2天前
|
Linux 网络安全 Python
linux后台运行命令screen的使用
linux后台运行命令screen的使用
14 2
linux后台运行命令screen的使用
|
2天前
|
Ubuntu Linux
查看Linux系统架构的命令,查看linux系统是哪种架构:AMD、ARM、x86、x86_64、pcc 或 查看Ubuntu的版本号
查看Linux系统架构的命令,查看linux系统是哪种架构:AMD、ARM、x86、x86_64、pcc 或 查看Ubuntu的版本号
23 3
|
8天前
|
Unix Linux 开发工具
在Linux中,有哪些基本的 Vim 命令?
在Linux中,有哪些基本的 Vim 命令?
|
9天前
|
自然语言处理 Linux API
Linux man命令英文天书?别怕,揭秘一招,让你瞬间解锁中文秘籍,轻松驾驭Linux命令海洋!
【8月更文挑战第22天】Linux以其开源特性、强大功能和灵活性深受技术爱好者喜爱。但对于新手而言,面对系统中众多命令及其英文man页面常感吃力。本文介绍如何将man命令内容转化为中文,降低学习门槛。首先强调man命令的重要性——它是获取Linux命令帮助的核心工具。接着,提出一种利用ccze工具结合在线翻译服务的方法,尽管需要额外处理,但对于寻求即时中文帮助的用户仍具价值。最后推荐使用tldr这样的工具,它提供简化的多语言man页面,方便快捷地查看中文命令说明,使学习过程更加顺畅。
28 1
|
8天前
|
存储 监控 安全
在Linux中,⼀个EXT3的文件分区,当使用touch test.file命令创建⼀个新文件时报错,报错的信息是提示磁盘已满,但是采用df -h命令查看磁盘大小时,只使用了,60%的磁盘空间,为什么会出现这个情况?
在Linux中,⼀个EXT3的文件分区,当使用touch test.file命令创建⼀个新文件时报错,报错的信息是提示磁盘已满,但是采用df -h命令查看磁盘大小时,只使用了,60%的磁盘空间,为什么会出现这个情况?
|
8天前
|
存储 监控 Linux
在Linux中,可以使用哪个命令查看系统的历史负载?
在Linux中,可以使用哪个命令查看系统的历史负载?
|
8天前
|
Linux Perl
在Linux中,如何使用请用 cut 或者 awk,sed命令取出 linux 中 eth0 的 IP 地址?
在Linux中,如何使用请用 cut 或者 awk,sed命令取出 linux 中 eth0 的 IP 地址?
|
2天前
|
Linux 网络安全
linux关闭方防火墙的命令
linux关闭方防火墙的命令
13 2
|
3天前
|
Web App开发 Linux 数据安全/隐私保护
Linux curl命令详解
Linux curl命令详解
|
8天前
|
域名解析 网络协议 Linux
在Linux中,iptables有哪相关的命令?
在Linux中,iptables有哪相关的命令?
下一篇
云函数