Linux 命令 - man 查看命令的文档
man 命令是 Linux 中最常用的命令,碰到任何让你疑惑的命令,都可以 man 一下来查看详情。不只是 shell 命令,C 语言库函数和系统调用等内容也可以通过 man 命令查看。
man 命令默认查看的是 shell 命令的文档,可以指定参数 2 查看系统调用,3 查看 C 库函数(需要提前安装)。可以在 Linux 中直接输入 man man
查看 man 命令的帮助文档,最常用的就是查看 shell 命令、系统调用和库函数,例如:
man printf
man 2 open
man 3 printf
man 文档:
NAME
man - an interface to the on-line reference manuals
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-m system[,...]] [-M path] [-S list] [-e extension] [-i|-I] [--regex|--wildcard]
[--names-only] [-a] [-u] [--no-subpages] [-P pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justification] [-p string] [-t] [-T[device]]
[-H[browser]] [-X[dpi]] [-Z] [[section] page[.section] ...] ...
man -k [apropos options] regexp ...
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
man -f [whatis options] page ...
man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L locale] [-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t] [-T[device]]
[-H[browser]] [-X[dpi]] [-Z] file ...
man -w|-W [-C file] [-d] [-D] page ...
man -c [-C file] [-d] [-D] page ...
man [-?V]
DESCRIPTION
man is the system's manual pager. Each page argument given to man is normally the name of a program, utility or function. The manual page associated with
each of these arguments is then found and displayed. A section, if provided, will direct man to look only in that section of the manual. The default
action is to search in all of the available sections following a pre-defined order ("1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7" by default, unless overrid‐
den by the SECTION directive in /etc/manpath.config), and to show only the first page found, even if page exists in several sections.
The table below shows the section numbers of the manual followed by the types of pages they contain.
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]
A manual page consists of several sections.
安装 man 手册
各大 Linux 发行版默认带了 shell 命令的 man 文档,其他文档需要自己下载。
安装最新版本的 man 手册
官方下载链接:https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/ 。在 man-pages-posix 文件夹下,有 POSIX 的 man 手册。
wget https://www.kernel.org/pub/linux/docs/man-pages/man-pages-4.16.tar.gz
tar -xvzf man-pages-4.16.tar.gz
cd man-pages-4.16
make install
当然也可以用 Linux 发行版自带的仓库安装,例如 Ubuntu:
apt-get install manpages
安装 C 库函数手册
首先执行下面的命令,如果报错找不到文档,则说明没有安装:
man 3 printf
Ubuntu 下需要一个个单独安装,或用通配符一次安装:
apt-get install manpages-dev
apt-get install manpages*
CentOS 则可以一次安装:
yum install man-pages
Linux 下 C 库函数的 man 手册的说明
- manpages:Linux 的基本命令的用法,针对 Linux 用户
- manpages-dev:Linux 及 C 标准库的 API,针对 Linux 开发者
- manpages-posix:POSIX 标准接口
- manpages-posix-dev:POSIX 的头文件和函数库的用法
Linux 命令 - man 查看命令的文档的更多相关文章
- 如何在命令行模式下查看Python帮助文档---dir、help、__doc__
如何在命令行模式下查看Python帮助文档---dir.help.__doc__ 1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...
- 在命令行模式下查看Python帮助文档---dir、help、__doc__
在命令行模式下查看Python帮助文档---dir.help.__doc__ 1.dir函数式可以查看对象的属性,使用方法很简单,举str类型为例,在Python命令窗口输入 dir(str) 即 ...
- Linux下内存查看命令
在Linux下面,我们常用top命令来查看系统进程,top也能显示系统内存.我们常用的Linux下查看内容的专用工具是free命令. Linux下内存查看命令free详解: 在Linux下查看内存我们 ...
- Linux用户登录查看命令总结 - w,who,last,lastlog
Linux用户登录查看命令总结 - w,who,last,lastlog linux shell 747 次阅读 · 读完需要 15 分钟 0 1. 查看登录用户信息 who -H 命令输出 NA ...
- 在Linux 安装Python3.5.6详细文档!!!!
在Linux 安装Python3.5.6详细文档!!!! 1.安装相关依赖库(工具包) yum install gcc patch libffi-devel python-devel zlib-de ...
- [转载]linux上用PHP读取WORD文档
在linux上用PHP读取WORD文档,其实是使用了 antiword程序把word文档转化为txt文档. 再使用php执行系统命令调用而已. 具体操作如下: 1.安装antiword 官方站:htt ...
- help python(查看模块帮助文档)
查看模块帮助文档: help(len) -- docs for the built in len function (note here you type "len" not &q ...
- Linux命令学习之路——变更文档拥有者:chown
使用权限:root用户 使用方式:chown [ -cvfRh ] [ --help ] [ --version ] user[ :group ] file... 作用:该命令用于改变文档的拥有者 注 ...
- Linux中内容查看命令"大PK"
众所周知linux中命令cat.more.less均可用来查看文件内容,当然还有我们"非主流"的vim以及使用较少的head.tail.tac. 下面我将介绍各种命令的用法及对比. ...
随机推荐
- h5 实现页面上拉加载更多数据
您好,您的上拉加载更多的代码来喽: html:(style部分:html部分:js部分--js部分主要就是监控上拉,调接口) //上拉加载更多css <style> .wait-loadi ...
- python paramiko模块:远程连接服务器
1. SFTP基于 用户名密码 登录服务器,实现上传下载: import paramiko transport = paramiko.Transport(()) # 生成trasport,配置主机名 ...
- 【HDU4034】Graph
题目大意:给定一个图的最短路,求原图中至少存在多少条边. 题解:利用 Floyd 的性质,枚举边 d[i][j],若存在一个不是两端点的点,使得 d[i][j]=d[i][k]+d[k][j] 成立, ...
- ax2+bx+c=0的根的算法
每日一练作业 写一个函数,接受三个整数a, b, c,计算ax2+bx+c=0 的根. 另外,在计算时应当判断 b2 - 4ac 是否大于0. 我们什么都没有,唯一的本钱就是青春.梦想让我与众不同,奋 ...
- null 的应用
它是 Oracle 中非常特殊的一种类型.它表示不确定,表示没有值.并且它能转化成所有的类型. 向数据库中插入空字符串时,oracle 会把它自动转化为 null 类型.所以,在查询空字符的时候: s ...
- ZROI 19.08.01 树上数据结构
1.总览 LCT 链分治(树剖) 点/边分治 2.点分治 一棵树,点有\(0/1\),多次修改,询问最远的两个\(1\)距离. 建出点分树,每个子树用堆维护:①最远的\(1\)距离:②它的每个儿子的① ...
- 基于gtid复制主要操作记录
基于gtid复制主要操作记录 一.安装系统依赖包 在主从上都要安装该依赖包. yum -y install perl-DBI yum -y install perl-DBD-MySQL yum -y ...
- HBase(1.0.2) API数据模型
几个相关类与HBase数据模型之间的对应关系 java类 HBase数据模型 HBaseAdmin 数据库(DataBase) HBaseConfiguration HTable 表(Table) H ...
- python 面向对象_2
self的理解 通俗理解self就是实例对象,实例化的是什么,self就是什么 实例变量: 经过实例化才能使用的变量 class Person(): def __init__(self,id,name ...
- 6.re正则表达式
import re import unicodedata s = "a00xoghasalexjkdfldhfjk" v = s.find("alex") pr ...