![為什麼linux上history指令的結果中有一個以「*」開頭的空白行?](https://rvso.com/image/1416685/%E7%82%BA%E4%BB%80%E9%BA%BClinux%E4%B8%8Ahistory%E6%8C%87%E4%BB%A4%E7%9A%84%E7%B5%90%E6%9E%9C%E4%B8%AD%E6%9C%89%E4%B8%80%E5%80%8B%E4%BB%A5%E3%80%8C*%E3%80%8D%E9%96%8B%E9%A0%AD%E7%9A%84%E7%A9%BA%E7%99%BD%E8%A1%8C%EF%BC%9F.png)
今天上班的時候,我想知道一個history
我不太熟悉的命令,而且我確信我剛剛執行過。但是,當我history
在同一個終端機視窗上運行時,我沒有發現任何有關該命令的資訊。讓我更加困惑,甚至惱火的是,我在 的輸出中發現了一個以「*」開頭的空白行history
。有人可以告訴我為什麼嗎?請給一些具體的解釋。
2008 make build_asdfasdfa
2009 ls
2010 cd asdfasdf
2011 ls
2012*
2013 exxxxxxxxxxxxxxxxxxx
2014 ls
2015 exxxxxxxxxxxxxxxxxx
2016 ls
2017 exxxxxxxxxxxxxxxxxxxxxx
2018 ls
答案1
如果已在 ReadLine 配置中開啟*
該屬性,則已修改的歷史記錄行會在命令開頭顯示。mark-modified-lines
ReadLine 文件的內容如下:
mark-modified-lines
This variable, when set to On, says to display an asterisk ('*') at the
start of history lines which have been modified. This variable is off
by default.