Linux手册指南

本文最后更新于:2022年9月4日 下午

man手册

man 手册提供了极佳的快速查询功能,当我们不熟悉某个指令的时候,可以通过在命令行输入 man + command 查询在线手册

  • section类别
    • 由数字标识,具体如下:

      1:可执行的程式或是shell 指令。
      2:系统呼叫(system calls,Linux 核心所提供的函数)。
      3:一般函式库函数。
      4:特殊档案(通常位于/dev)。
      5:档案格式与协定,如 /etc/passwd
      6:游戏。
      7:杂项(巨集等,如man(7)、groff(7))。
      8:系统管理者指令(通常是管理者 root 专用的)。
      9:Kernel routines(非标准)。

    • man num command 指定查看num标识的命令
    • man -aw command查看命令有几个section列表
  • man -k command可以帮助我们线上搜索所有相关内容,并且附带对应的简要说明
  • man手册中文翻译版

tldr

对于某些命令,man 的内容实在太多,比如,我们输入 man gcc | wc -l来统计gcc的man手册行数,结果有19991行,这太多了,因此我们需要一个精简版的man指令,它就是tldr

tldr"too long; didn’tread"的缩写,旨在显示简单版的命令文档,并提供常用命令示例,它是github上一个开源项目

一键安装:

1
npm install -g tldr

在这里插入图片描述

当我们输入tldr curl,得到如下输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ tldr curl

# curl
Transfers data from or to a server.
Supports most protocols, including HTTP, FTP, and POP3.
More information: <https://curl.haxx.se>.

- Download the contents of an URL to a file:

curl http://example.com -o filename

- Download a file, saving the output under the filename indicated by the URL:

curl -O http://example.com/filename

- Download a file, following [L]ocation redirects, and automatically [C]ontinuing (resuming) a previous file transfer:

curl -O -L -C - http://example.com/filename

- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`):

curl -d 'name=bob' http://example.com/form
- Send a request with an extra header, using a custom HTTP method:

curl -H 'X-My-Header: 123' -X PUT http://example.com
- Send data in JSON format, specifying the appropriate content-type header:

curl -d '{"name":"bob"}' -H 'Content-Type: application/json' http://example.com/users/1234

同时,该项目还提供了网页版:tldr.ostera.io 在线查询

在这里插入图片描述

Linux上一些其它参考


Linux手册指南
http://gls.show/p/50b51ea9/
作者
郭佳明
发布于
2022年9月4日
许可协议