我想複製如果您運行的歷史,你會得到相反的順序命令到剪貼板像這樣複製到剪貼板最後n個命令,在終端
$ command1
$ command2
,所以我想就跳過了一些來自尾部的行,並用'$'替換輸入行號。你可能會認爲這是一個非常有用的速記,當你需要登錄你的工作流程或寫文檔。
例子:
$ history
1340 pass
1341 pass insert m clouds/cloud9
1342 pass insert -m clouds/cloud9
1343 sudo service docker start
1344 history
所以,你怎麼把它轉換成:1
$ sudo service docker start
$ pass insert -m clouds/cloud9
...etc
你知道'tac'命令?還有這些其他問題? [Q1](http://stackoverflow.com/questions/742466/how-can-i-reverse-the-order-of-lines-in-a-file)[Q2](http://stackoverflow.com/問題/ 8017456/output-file-lines-from-last-to-first-in-bash) – Jdamian
我之前沒有使用它。謝謝! – grokkaine