我想做类似的事情
history 2960-2966
具有这种输出的期望:
2960 2013-12-09 20:59:35 bundle update 2961 2013-12-09 21:00:08 git st 2962 2013-12-09 21:00:12 git add . 2963 2013-12-09 21:01:19 git st 2964 2013-12-09 21:01:43 git log 2965 2013-12-09 21:02:45 git st 2966 2013-12-09 21:02:57 git reset HEAD Gemfile.lock
在bash shell中有可能吗?
更新:我的问题是关于查看这七个历史记录行,而不是日期本身;碰巧我HISTTIMEFORMAT
在.bash_profile中有一条指令来提供日期和时间戳。如果要删除它,那么我希望history 2960-2966
或其他一些东西来生成此输出:
2960 bundle update 2961 git st 2962 git add . 2963 git st 2964 git log 2965 git st 2966 git reset HEAD Gemfile.lock
我希望显示所需的历史记录行,最好使用在.bash_profile中指定的任何自定义设置。
我为什么要这个?一个非常简单的用例是:我做类似的事情来history | grep 'bundle update'
获得一个不错的结果,然后想要查看该点的一些历史记录以及更远的几行内容,或者是将该点括号括起来的历史记录。