免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 573 | 回复: 0
打印 上一主题 下一主题

[文本处理] history -a ? [复制链接]

论坛徽章:
6
程序设计版块每日发帖之星
日期:2016-05-11 06:20:00操作系统版块每日发帖之星
日期:2016-05-12 06:20:00每日论坛发贴之星
日期:2016-05-12 06:20:00操作系统版块每日发帖之星
日期:2016-05-14 06:20:00程序设计版块每日发帖之星
日期:2016-05-31 06:20:00每日论坛发贴之星
日期:2016-05-31 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-03-03 04:07 |只看该作者 |倒序浏览
-a  :将目前新增的history 指令新增入 histfiles 中,若没有加 histfiles ,
则预设写入 ~/.bash_history


# history
    1  [2017-03-03 11:44:24] : history -w
    2  [2017-03-03 11:44:43] : cat /root/.bash_history
    3  [2017-03-03 11:44:55] : history
    4  [2017-03-03 11:45:13] : history -w /root/.bash_history
    5  [2017-03-03 11:45:28] : cat /root/.bash_history
    6  [2017-03-03 11:45:45] : history
    7  [2017-03-03 11:48:11] : cat /root/.bash_history > /home/ixi/.bash_history
    8  [2017-03-03 11:49:10] : echo '123'
    9  [2017-03-03 11:49:14] : echo '124'
   10  [2017-03-03 11:49:19] : history
   11  [2017-03-03 11:49:27] : cat /root/.bash_history
   12  [2017-03-03 11:49:38] : history -a
   13  [2017-03-03 11:49:41] : cat /root/.bash_history
   14  [2017-03-03 11:50:06] : history -a /root/.bash_history
   15  [2017-03-03 11:50:09] : cat /root/.bash_history
   16  [2017-03-03 11:52:33] : history
   17  [2017-03-03 11:57:16] : cat ~/.bash_history
   18  [2017-03-03 11:57:25] : history -a
   19* [2017-03-03 11:57:27] : vi ~/history
   20  [2017-03-03 11:57:47] : history
   21* [2017-03-03 11:58:50] : vi ~/h01
   22  [2017-03-03 11:58:56] : ls ~/h*
   23  [2017-03-03 11:59:00] : ls ~/
   24  [2017-03-03 11:59:27] : cat ~/.bash_history
   25  [2017-03-03 11:59:53] : history > ~/h01
   26  [2017-03-03 12:00:03] : cat ~/h01
   27  [2017-03-03 12:03:29] : history
您在 /var/mail/root 中有新邮件

$ 160 [2017-03-03 12:03:29] 星期五  root /01/jsh
# cat /root/.bash_history
#1488512664
history -w
#1488512683
cat /root/.bash_history
#1488512695
history
#1488512713
history -w /root/.bash_history
#1488512981
cat /root/.bash_history
#1488513006
history -a /root/.bash_history

$ 161 [2017-03-03 12:03:46] 星期五  root /01/jsh
#
------------------------------
history
12;14行
  1. cat /root/.bash_history
复制代码
cat ~/.bash_history  并没有看到新增的

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP