小编ina*_*lus的帖子

重新运行多个历史命令

想象一下,您刚刚运行了十几个命令。说...

$ cd foo/    # history cmd #10000 (my history is very long)
$ ... more commands ...
$ cd ../     # history cmd #10012 
Run Code Online (Sandbox Code Playgroud)

我知道我可以重新运行它们,!-12 && !-11 && !-10 && (and so on) && !!如果它们碰巧刚刚运行(不太可能)或!10000 && !10001 && !10002 && (and so on),但是有没有比用 bang 和&符号手动输入每个历史数字更简单的方法?

在 bash 中是否有某种我不知道的范围的东西?

例如!{10000-10012}#这样的东西,只能工作。

bash command-history

30
推荐指数
1
解决办法
8404
查看次数

标签 统计

bash ×1

command-history ×1