4
如何从历史记录中获取最后N条命令?
我想查看我的计算机中最后N条命令是什么history。我以为history | tail -n 5会做到这一点,但我注意到多行命令所占的行数与其相同。 $ echo "hello how are you" $ history | tail -2 how are you" 1051 history | tail -2 所以我的问题是:我是否必须解析命令的输出才能完成此任务?
与其他Bourne / POSIX shell相对,GNU的Bourne Again SHell特有的问题。对于一般关于Unix shell的问题,请改用/ shell标记。