【问题标题】:how can I filter out same commands in tcsh history如何过滤掉 tcsh 历史记录中的相同命令
【发布时间】:2021-04-20 05:56:04
【问题描述】:

我正在使用 tcsh。但是对存储在历史文件中的相同命令感到恼火。我必须使用多次向上箭头来绕过相同的命令,非常不方便。 任何人都可以提供一些帮助来解决这个不便。

【问题讨论】:

  • Bash 有erasedups
  • @zhaoyang : 我觉得这个问题最好在superuser问,因为它与配置你的tcsh有关,与编程无关。

标签: linux shell history tcsh


【解决方案1】:

这里有histdup 设置;来自tcsh(1)

   histdup (+)
           Controls handling of duplicate entries in the history list.  If
           set to `all' only unique history events are entered in the
           history list.  If set to `prev' and the last history event is
           the same as the current command, then the current command is
           not entered in the history.  If set to `erase' and the same
           event is found in the history list, that old event gets erased
           and the current one gets inserted.  Note that the `prev' and
           `all' options renumber history events so there are no gaps.

【讨论】:

  • 谢谢。我使用 set histdup=prev 完美解决了我的问题。
猜你喜欢
  • 2012-12-11
  • 1970-01-01
  • 1970-01-01
  • 2013-08-17
  • 1970-01-01
  • 2010-10-14
  • 1970-01-01
  • 2017-09-13
  • 2017-06-19
相关资源
最近更新 更多