Display history record command execution time in Bash

Source: Internet
Author: User


Bash displays the execution time of commands recorded by history. Bash displays the execution time of commands recorded by history. In fact, Linux has long recorded the time when we hit each command. The adjustments in this way can greatly enrich the readability of history. Of course, this is also a self-check method in information security audit. If your Shell has a good grasp of this kind of thing, you can totally put it apart, learn and use it, but it is better to remember it. So I wrote it down for my reference (the above is purely my opinion and does not participate in the discussion. The following command is absolutely correct ^-^) www.2cto.com [root @ unix-like-test ~] # Export HISTTIMEFORMAT = '% F % T-' [root @ unix-like-test ~] # History 1 14:50:22-vim/etc/selinux/config 2 2012-10-010-09 14:50:22-yum install vim 3 2012-10-010-09 14:50:22-vi/etc/yum. repos. d/iso. repo 4 14:50:22-yum install vim 5 14:50:22-vi/etc/yum. repos. d/iso. repo 6 14:50:22-yum install vim 7 14:50:22-yum gruop list 8 14:50:22-yum gruoplist 9 14:50:22-yum gruopinstall 10 14:50:22-yum install yum 11 14:50:22-yum install yum 11-yum install yum * 12 14:50:22-vim 13 14:50:22-yum install man 14 14:50:22-yum install scp 15 14:50:22-yum install sshd * 16 14:50:22-yum install sshd 17 14:50:22- yum groupinstall "Server Configuration Tools" 18 14:50:22-yum grouplist

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.