How to query the history operation time in linux

Source: Internet
Author: User
In linux, how does one view the history operation time? Here we will share the specific implementation methods. if you need them, please refer to them.

To view the operation time of the history record in a linux operating system, follow these steps:
1. modify the/etc/profile file and add: export histtimeformat = "% f % t 'whoam'" at the end '"

2. in the user directory, modify the file. bash_profile and add export histtimeformat = "% f % t 'whoam '"

Log out of the terminal and log on again.

For example, view the history operation time:


Copy codeThe code is as follows:
[Root @ jb51 ~] $ History | tail
989 19:06:04 admin vi. bash_profile
990 22:06:03 admin ll
991 22:06:09 admin vi. bash_profile
992 22:06:18 admin ll-ag
993 22:06:55 admin history | tail
994 22:07:11 admin vi. bash_profile
995 22:07:24 admin history | tail
996 22:07:32 admin eixt
997 22:07:35 admin exit
998 22:07:41 admin history | tail

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.