1、历史命令
[root@localhost ~]# history [选项] [历史命令保存文件包]
选项
-c:清空历史命令
-w:把缓存中的历史命令写入历史命令保存文件 /.bash_history
[root@localhost ~]# history
[root@localhost ~]# history -w
历史命令默认会保存1000条,可以在环境变量配置文件/etc/profile中进行修改
[root@localhost ~]# vim /etc/profile
2、历史命令的调用
(1)使用上下箭头调用以前的历史命令
(2)使用“!n”重复执行第n条历史命令
(3)使用“!!”重复执行上一条命令
(4)使用“!字串”重复执行最后一条以该字串开头的命令
[root@localhost ~]# !2
[root@localhost ~]# !!
[root@localhost ~]# !his
3、命令补全
使用Tab键进行补全