charlie21
V2EX  ›  问与答

终端历史纪录 history 的问题

  •  
  •   charlie21 · Jan 4, 2016 · 2391 views
    This topic created in 3960 days ago, the information mentioned may be changed or developed.
    关于 history 10 这个命令,在不同 shell 下有不同结果?

    在用 bash 的时候, 默认显示的是 最近十条的命令(这是我想要的)
    在用 zsh 的时候, 默认显示的是 第一到第十条命令。

    你们的电脑是这样吗?
    如果是,如何才能让在 zsh 下显示 最近十条记录 ?
    4 replies  •  2016-01-04 21:12:47 +08:00
    theFool
    theFool
    Jan 4, 2016❤️1
    1
    history | tail -n x
    charlie21
    charlie21
    OP
    Jan 4, 2016
    2
    @theFool 多谢正解
    500miles
    500miles
    Jan 4, 2016❤️1
    3
    https://github.com/quorzz/HandyTools/blob/master/src/hs.sh

    之前也在烦这个问题 就撸了这个小脚本

    过滤掉了 重复的 和 比较短的命令 ,, 显示也更好看些
    charlie21
    charlie21
    OP
    Jan 4, 2016
    4
    历史纪录 -> 历史记录
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1530 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 07:21 · PVG 15:21 · LAX 23:21 · JFK 02:21
    ♥ Do have faith in what you're doing.