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命令-目录
在工作中总会零零散散使用到各种Linux命令,从今天开始详细的学习一下linux常用命令,坚持每天一个命令,学习的主要参考资料为: 1.竹子-博客(https://www.cnblogs.com/pe ...
- N天学习一个Linux命令之free
用途 查看系统内存(物理/虚拟/缓存/共享)使用情况 用法 free [-b | -k | -m | -g | -h] [-o] [-s delay ] [-c count ] [-a] [-t] [ ...
- N天学习一个linux命令之ping
用途 检测主机是否可到达,也就是说,目标主机是否可以联网,还可以用于检测网速.通过发送ICMP ECHO_REQUEST数据包检测. 用法 ping [options] destination 常用选 ...
- N天学习一个linux命令之kill
用途 用于终止进程 用法 kill [-s signal|-p] [--] pid... kill -l [signal] 说明 1.默认发送信号15(请求终止进程,程序可以捕获,操作系统会杀死没有对 ...
- N天学习一个linux命令之du
用途 统计文件或者目录占用硬盘空间大小 用法 du [OPTION] [FILE]du [OPTION] --files0-from=F 常用参数 -a, --all统计所有文件,不仅仅是目录 -b, ...
- N天学习一个linux命令之scp
用途 通过ssh通道,不同主机之间复制文件 用法 scp [options] [user@host:]file1 [user2@host2:]file2 常用参数 -1使用 ssh 1协议 -2使用s ...
- N天学习一个Linux命令之grep
前言任何系统都会出问题,出了问题一般怎么排查BUG?这个时候程序中记录的异常日志以及关键节点的日志就非常重要了,面对一大堆的日志文件,怎么找出我们需要的有用信息呢?linux中可以使用grep命令查找 ...
- N天学习一个Linux命令之dmesg
用途 显示系统自检信息和设备信息 用法 dmesg [-c] [-r] [-n level] [-s bufsize] 常用选项 选项 含义 说明 -c 输出ring buffer内容并且清空ring ...
- N天学习一个Linux命令之sudo
前言 新项目打算采用运维搭建的发布系统发代码,发布后生效前需要做一些处理,因为发布系统登录目标机器使用的是非root账号,所以需要使用sudo来提升权限.当执行sudo cd /xxx/xx时会提示报 ...
随机推荐
- DB2锁表或超时解决方案
DB2锁表或超时 一.场景 对数据表进行更新(查询没问题),错误提示如下: SQLCODE=-911, SQLSTATE=40001, DRIVER=3.63.75SQL0911N The curre ...
- JavaScript入门二
******函数****** **函数定义** //普通函数定义 function f1() { console.log("Hello word!") } //带参数的函数 fun ...
- Educational Codeforces Round 24 题解
A: 考你会不会除法 //By SiriusRen #include <bits/stdc++.h> using namespace std; #define int long long ...
- 设计模式 Singleton 单例 懒汉,线程安全
首先来明确一个问题,那就是在某些情况下,有些对象,我们只需要一个就可以了, 比如,一台计算机上可以连好几个打印机,但是这个计算机上的打印程序只能有一个, 这里就可以通过单例模式来避免两个打印作业同时输 ...
- 【转】linux下passwd命令设置修改用户密码
1.passwd 简单说明: 我们已经学会如何添加用户了,所以我们还要学习设置或修改用户的密码:passwd命令的用法也很多,我们只选如下的几个参数加以说明:想了解更多,请参考man passwd或p ...
- 【转】Linux下history命令用法
转自:http://blog.sina.com.cn/s/blog_5caa94a00100gyls.html 如果你经常使用 Linux 命令行,那么使用 history(历史)命令可以有效地提升你 ...
- Mybatis的Dao向mapper传多个参数(三种解决方案)
第一种方案 : DAO层的函数方法 Public User selectUser(String name,String area); 对应的Mapper.xml <select id=" ...
- Java引用jar的优化
一般java的类文件开头都是各种引用: 如 上图的引用可以写成
- 初识关系型数据库(SQL)与非关系型数据库(NOSQL)
一.关系型数据库(SQL): Mysql,oracle 特点:数据和数据之间,表和字段之间,表和表之间是存在关系的 例如:部门表 001部分, 员工表 001 用户表,用户名.密码 分类表 和 商 ...
- 基于zk“临时顺序节点“的分布式锁
import org.apache.zookeeper.*; import org.apache.zookeeper.data.Stat; import java.io.IOException; im ...