dur*_*uru 8 linux bash history command-line
每次我需要这个时,我都会用谷歌搜索 10 分钟。我不知道如何更好地表达这一点,以便 Google 立即找到它,但我需要在某些行之间检索 bash 历史记录,例如:
$ history --start 321 --end 456
#to retrieve history from 321 and to 456
Run Code Online (Sandbox Code Playgroud)
使用头部和尾部。
history | head -n 456 | tail -n 136
这将获得前 456 个(直到您想要的最后),然后获得最后一个 136 个(计算为 456 - 136 = 320,但将从历史记录中的第 321 条记录中获取)。
| 归档时间: |
|
| 查看次数: |
7761 次 |
| 最近记录: |