码迷,mamicode.com
首页 > 系统相关 > 详细

linux常用命令 history命令

时间:2018-04-19 13:59:12      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:调用   缓存   lin   ks.cfg   yum   清空   get   bash   箭头   

历史命令

history [选项] [历史命令保存文件]

选项
'-c'
清空历史命令
'-w'
把缓存中的历史命令写入历史命令保存文件~/.bash_history
[root@ssgao1987 ~]# cat .bash_history 
exit
yum -y install yum
yum -y install wget
…

历史命令的调用

*) 使用上,下箭头调用以前的历史命令
*) 使用"!n"重复执行第n条历史命令
*) 使用"!!" 重复执行上一条命令
*) 使用"!字串"重复执行最后一条该字串开头的命令
[root@ssgao1987 ~]# ls
anaconda-ks.cfg ?install.log ?install.log.syslog ?shell_01.sh ?ssgao
[root@ssgao1987 ~]# !!
ls
anaconda-ks.cfg ?install.log ?install.log.syslog ?shell_01.sh ?ssgao
[root@ssgao1987 ~]# !ls
ls
anaconda-ks.cfg ?install.log ?install.log.syslog ?shell_01.sh ?ssgao

linux常用命令 history命令

标签:调用   缓存   lin   ks.cfg   yum   清空   get   bash   箭头   

原文地址:https://www.cnblogs.com/ssgao/p/8881782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!