Bash下顯示history記錄命令的執行時間

來源:互聯網
上載者:User


Bash下顯示history記錄命令的執行時間 Bash下顯示history記錄的命令的執行時間,其實Linux 早就記錄下來了我們敲擊每條指令的時間。這樣做下調整可以極大的豐富我們history的可閱讀性當然這也是資訊安全審計中自查的一個辦法     如果你Shell掌握得蠻好這種東西完全可以舉一反三,活學活用,但是好記憶不如爛筆頭。所以我就把他記下來以供自己參考(以上純屬個人觀點不參與討論,下面命令絕對正確^-^)  www.2cto.com  [root@unix-like-test ~]# export HISTTIMEFORMAT='%F %T - ' [root@unix-like-test ~]# history    1 2012-10-09 14:50:22 - vim /etc/selinux/config     2 2012-10-09 14:50:22 - yum install vim    3 2012-10-09 14:50:22 - vi /etc/yum.repos.d/iso.repo    4 2012-10-09 14:50:22 - yum install vim    5 2012-10-09 14:50:22 - vi /etc/yum.repos.d/iso.repo    6 2012-10-09 14:50:22 - yum install vim    7 2012-10-09 14:50:22 - yum gruop list    8 2012-10-09 14:50:22 - yum gruoplist    9 2012-10-09 14:50:22 - yum gruopinstall   10 2012-10-09 14:50:22 - yum install yum    11 2012-10-09 14:50:22 - yum install yum*   12 2012-10-09 14:50:22 - vim    13 2012-10-09 14:50:22 - yum install man   14 2012-10-09 14:50:22 - yum install scp   15 2012-10-09 14:50:22 - yum install sshd*   16 2012-10-09 14:50:22 - yum install sshd   17 2012-10-09 14:50:22 - yum groupinstall "Server Configuration Tools"   18 2012-10-09 14:50:22 - yum grouplist   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.