1.当不知道一个命令的作用时
whatis 命令
whatis cal ##显示cal命令的用途
cal (1) - display a calendar ######这个括号里面的1,1p是在man里面用的###man 1 cal
命令 --help ##获得命令的帮助 --help只适用与命令
Usage:
cal [options] [[[day] month] year]
Options:
-1, --one show only current month (default)
-3, --three show previous, current and next month
-s, --sunday Sunday as first day of week
-m, --monday Monday as first day of week
-j, --julian output Julian dates
-y, --year show whole current year
-V, --version display version information and exit
-h, --help display this help text and exit
whatis 命令
whatis cal ##显示cal命令的用途
cal (1) - display a calendar ######这个括号里面的1,1p是在man里面用的###man 1 cal
cal (1p) - print a calendar#####################man 1p cal##################
命令 --help ##获得命令的帮助 --help只适用与命令
Usage:
cal [options] [[[day] month] year]
Options:
-1, --one show only current month (default)
-3, --three show previous, current and next month
-s, --sunday Sunday as first day of week
-m, --monday Monday as first day of week
-j, --julian output Julian dates
-y, --year show whole current year
-V, --version display version information and exit
-h, --help display this help text and exit
##注意#########################
[选加] ##可以加也可以不加
... ##加的个数可以是任意多个
<必须加> ##不可缺少的信息
cal 的 options 里面的一个选项 -j 是距离1月1日有多少天
cal -j 2 3 2018 会显示出2018.2.3是第61天
3,查看文件的帮助时,不能使用--help,而要使用man
man的级别
1 ##命令
2 ##内核调用的接口
3 ##函数库
4 ##特殊文件比如设备文件
5 ##系统文件
6 ##游戏
7 ##包信息
8 ##系统密令
9 ##内核规则
man date ##查看date命令的帮助手册
进入man页面后
/关键字 #查找关键字
n #关键字向下匹配
N #关键字向上匹配
q #退出
#######
"注意:当man或者whatis命令无法查询帮助是,是因为系统没有加载帮助数据库"
"处理方式:执行 mandb"