man format and display the on-line manual pages
#help command
#man bash
man format and display the on-line manual pages
command help
man command
info command
程序自身帮助文档:README、INSTALL、changelog
程序官方文档
发行版的官方文档
man page 的配置文件 /etc/man_db.conf | man.config 中定义了man读取帮助文件的路径:如 /usr/man ; /usr/share/man ; /usr/local/share/man 以及man 读取帮助文件的格式等信息。
man format and display the on-line manual pages
man的配置文件/etc/man_db.config,定义了man查找的目录,文件格式为.gz.bz2等
man -f rm = whatis rm
man -k rm #所有带有‘rm’的命令或文件
man -a passwd #列出所有章节 q 退出一章,接着显示下一章
man -M /path/to/somewhere comman #到指定目录找命令的帮助手册并显示
man bash #所有内部命令的详细信息,比help命令更详细
1 Executable programs or shell commands(用户命令)
2 System calls (functions provided by the kernel)(系统调用)
3 Library calls (functions within program libraries)(C库调用)
4 Special files (usually found in /dev)(设备文件及特殊文件)
5 File formats and conventions eg /etc/passwd(配置文件格式)
6 Games(游戏)
7 Miscellaneous (including macro packages andconventions), e.g.man(7), groff(7)(杂项)
8 System administration commands (usually only for root)(管理类的命令)
9 Kernel routines (Non standard)(非标准的Linux 内核API)
man 命令的操作方法
man的配置文件/etc/man_db.config,定义了man查找的目录,文件格式为.gz.bz2等
space、 Ctrl v、 Ctrl f、 Ctrl F、f、PgDn #下翻一页
d #下翻半屏
u #上翻半屏
j、e、Enter #下一行
k、y #上一行
1G #首行
G #末尾
/string、?string #find
数字 #直接跳转到那一行
?那么如何使用man完成一次真正的查找呢,在此举一例: "修改 /etc/issue 文件,实现登录时提示当前登录的终端号,主机名和当前时间."咋一看,一脸萌,遂开始动手:首先是whatis issue可以看到issue的帮助文件在man page中的章节

于是 :到man (5) issue看到信息量有点少,于是SEE ALSO找到mingetty,这是告诉我们如果信息量不够可以再man他们找到更详细的信息

于是 :man其中一个吧,这里选择man mingetty不要问我为什么,因为答案在这里man mingeyy往下翻,找到ISSUE ESCAPES,这里告诉我们 /etc/issue 这个文件使用的有特定含义的转义符号

于是 :开始修改 /etc/issue ,由于普通用户没有权限修改该文件,请切换root用户,添加 \l @ \n at \t \d 就完事了。。

结果 :在用户登录之前,成功显示了终端号、主机名和当前时间。可见issue文件配置了用户登录时的提示信息,对于当今的恶意网络攻击行为,友情提示,不要暴露自己的系统信息!!

此外在/usr/share/doc #存放安装程序的说明文档 3、info同man,像一个网站,有些命令更详细
u/p/n/l #上一层/前/下/最后一个链接
enter跳转
s abc 搜索abc
q退出
Tab移动到下一 * 号的链接
PgUP、PgDn、方向键
获取其他帮助 1、通过本地文档获取帮助/usr/share/doc目录下包括了多数安装软件的相关原理说明
2、第三方程序的官方文档通过发行版官方提供的文档光盘或网站可以获得,如红帽知识库
_ http://kbase.rehat.com
_ http://www.redhat.com/docs
_ http://access.redhat.com
_ sosreport
命令收集所有系统上的日志信息的工具,并自动打成压缩包,方便技术支持人员和红帽全球支持提供分析问题的依
据
5、history在用户~目录/ .bash_history文件中存放历史命令,刚执行的命令保存在内存中即history命令看到的,当用户 正常登出 时内存中新增的命令写入.bash_history文件中,
HISTSIZE中定义了所有用户保存history数的默认大小,在~/.profile修改当前用户的HISTFILE #在~目录下的.bash_profile文件中定义
HISTTIMRFORMAT #定义了history list和history file中的时间格式
HISTIGNORE #定义了不予记录的命令
HSITCONTROL #参数有四(ignorespace、ignoredups、ignoreboth、erasedups),实现了不记录重复命令和空格开头的命令。在man bash中有如下一句话: A colon-separated list of values controlling how commands are saved on the history list. 说的是可以用 ; 号分割参数,以此实现多个功能。
使用详情!n | #!-n
!string #执行最近的‘string’开头的命令
?string #包含‘string’的命令
!! | 上键 | Ctrl p | #!-1 #重复上条命令
!n:^ | !n:$ | !n:* | !n:n # 引用history中第n个命令的(第一个、最后一个、所有、第n个)参数
!string:^ | !string:$ | !string:* | !string:n #引用history中以string开头的(第)个参数
Ctrl r #搜索某个命令(命令关键字或参数关键字)
Esc . #引用上条命令的最后一个参数a
Alt+. #同时按住
!$ #最后一个参数
!^ #第一个参数
!:n #第几个参数
!* #所有参数
history -c #清除内存中的history,相当于 HISTSIZE=0
history -anrw filename #从文件中读取记录到history list
history -d n #删除第n条历史记录
history -a #写入到文件中
history -n #read from file but not already