星空网 > 软件开发 > 操作系统

N天学习一个Linux命令之帮助命令:man

前言

工作中每天都在使用常用的命令和非常用的命令,忘记了用法或者参数,都会bing一下,然后如此循环。一直没有真正的系统的深入的去了解命令的用法,我决定打破它。以前看到有人,每天学习一个linux命令,我现在没有这么充足时间,我恐怕一周学习一个linux命令我都做不到,想想我还是N天学习一个linux命令吧,从现在开始算起。

 

用途

显示命令帮助文档以及用法

 

用法

man [options] [section] cmd

 

命令文档部分说明

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.

 

常用参数用法

显示命令版本

[root@localhost ~]# man -V
man 2.6.3

查看命令帮助信息

[root@localhost ~]# man -h
Usage: man [OPTION...] [SECTION] PAGE...

显示指定命令的配置文件

默认配置所使用的配置文件/etc/man_db.conf
[root@localhost ~]# man -C /etc/man.conf man

显示调试信息

[root@localhost ~]# man -d man
From the config file /etc/man_db.conf:
Mandatory mandir `/usr/man'.
Mandatory mandir `/usr/share/man'.
Mandatory mandir `/usr/local/share/man'.
Path `/bin' mapped to mandir `/usr/share/man'.
Path `/usr/bin' mapped to mandir `/usr/share/man'.
Path `/sbin' mapped to mandir `/usr/share/man'.
Path `/usr/sbin' mapped to mandir `/usr/share/man'.
Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.

输出命令原始文档所在路径

[root@localhost ~]# man -w man
/usr/share/man/man1/man.1.gz

输出命令转义文档所在路径

[root@localhost ~]# man -W man

显示指定输出文档内容使用的命令

默认使用的命令是less
[root@localhost ~]# man -P cat man
MAN(1) Manual pager utils MAN(1)
NAME
man - an interface to the on-line reference manuals

输出格式化文档之后的文本格式内容

[root@localhost ~]# man man | col -b > man.log

 

后记

1 大部分命令都会有帮助文档,man命令可以跟这些帮助文档交互。
2 后端开发多多少少都需要维护类unix服务器,平时多深入了解命令的用**对平时的工作很有帮助。

 

参考资料

【1】man -h 以及 man man




原标题:N天学习一个Linux命令之帮助命令:man

关键词:linux

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

印度双清真的那么难吗?印度清关规定有哪些?:https://www.ikjzd.com/articles/14198
先施质检:埃及COC认证如何办理流程是怎样的?:https://www.ikjzd.com/articles/141980
7个小tips教你提升独立站在Facebook广告的转化 - 独立站广告转化:https://www.ikjzd.com/articles/141981
​运营技巧:如何利用亚马逊新品扶持期快速出单?:https://www.ikjzd.com/articles/141982
亚马逊广告2021年一季度7大更新汇总:https://www.ikjzd.com/articles/141983
法国、奥地利法规已实行,不合规将限制销售权限!:https://www.ikjzd.com/articles/141985
三百元以内千兆路由器怎么选择?:https://www.vstour.cn/a/363184.html
千岛湖绿城度假酒店的简介:https://www.vstour.cn/a/363185.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流