Let the Linux History command show the operation time

Source: Internet
Author: User

Many people will use the history of this command, which means to list all the actions of the current user (by default), but many distributions of the default history is no user and operation time, this is necessary to view the original operation of the content of the time to provide trouble, man The next history, found that there is a variable can be set to the history of this display format, this variable is Histtimeformat

Just execute the following command:

Export histtimeformat= "' WhoAmI ': | %F | %T: | "

Then you can see the history with the user and time, save this to the current user's. Bash_profile inside, you can boot automatically loaded
The following is the display effect:

  330  root : |  2012-08-24  | 17:47:12: |  yum search nfs  331  root : |  2012-08-24  |  17:47:12: | yum install nfs4-acl-tools  332  root : |   2012-08-24  | 17:47:12: | nfsiostat   333  root :  |  2012-08-24  | 17:47:12: | nfs4_editfacl   334   root : |  2012-08-24  | 17:47:12: | nfs4_editfacl -- help  335  root : |  2012-08-24  | 17:47:12: |  man nfs4_editfacl  336  root : |  2012-08-24  |  17:47:12: | nfs4_getfacl   337  root : |   2012-08-24  |  17:47:12: | nfs4_getfacl -h  338  root : |  2012-08-24   | 17:47:12: | nfs4_getfacl -h  339  root : |   2012-08-24  | 17:47:12: | nfs4_getfacl -H  340   root : |  2012-08-24  | 17:47:12: | ls  341   Root : |  2012-08-24  | 17:47:12: | ifconfig

It's not bad.

This article is from the "Boyhack" blog, make sure to keep this source http://461205160.blog.51cto.com/274918/1722781

Let the Linux History command show the operation time

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.