美文网首页
history命令

history命令

作者: 凉风儿 | 来源:发表于2017-02-28 22:31 被阅读0次

history: history [-c] [-d 偏移量] [n] 或 history -anrw [文件名] 或 history -ps

栗子:

1. history // 显示所有使用的历史命令列表

2. history 10 // 显示最近使用的10条命令

3. history -w // 将历史命令写入 ~/.bash_history文件

4. echo $HISTSIZE // 显示系统会记录的命令条数

5. !5 // 执行第五条命令

6. !! // 执行上一条命令

7. !ec // 执行最近以ec开头的命令

问题:

1. 同一帐号同时多次登录的history写入问题

2. 无法记录时间

答案参见《鸟哥的Linux私房菜》p319

相关文章

  • Shell基础

    一、历史命令history history命令 history-c 清空历史命令history-w 把缓存(当前会...

  • Linux命令 history 2019-02-20

    history命令 history命令:用于显示历史记录和执行过的指令命令。history命令读取历史命令文件中的...

  • 2-4 history 命令

    history:显示历史命令。 1、history 查看历史输入。 2、快速执行 history 中的历史命令。 ...

  • Linux常用命令

    操作命令 基础命令 Clear(ctrl+l)清屏History 查看历史命令history -c 清除历史命令 ...

  • history

    history显示近期执行的命令 显示history保存多少条命令 显示日志记录文件 设置history的忽略 修...

  • 21 历史命令与命令补全

    history 历史命令history [选项] [历史命令保存文件]-c 清空历史命令-w 把缓存中的历史命令写...

  • linux history命令

    history命令history -c 清空历史所有输入命令记录!序号 执行历史命令中序号为2的命令例如:

  • 几个做开发很有用的linux命令

    1.history查看命令输入历史 可以用history来查看shell终端输入命令的历史,history num...

  • linux(十四)history- 复用输入历史

    history history 这个命令用来管理你在shell中曾经输入过的命令history -n显示最近n条命...

  • linux-history使用

    history命令可以查看历史输入的命令。历史的命令记录存储在~/.bash_history文件中。 查看历史命令...

网友评论

      本文标题:history命令

      本文链接:https://www.haomeiwen.com/subject/gpufgttx.html