In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article analyzes "how to use the Linux system history command to display time". The content is detailed and easy to understand. Friends who are interested in "how to use the Linux system history command to display time" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "how to display time with Linux system history commands".
The partners who have come into contact with the Linux system are familiar with the history command. When we execute the command in the terminal, all the executed commands will be in the .bash _ history file to help us review the commands that the user has executed before, but will not show the specific time of the execution, so how to make the history command display the time?
Method 1: run the following command to temporarily set the HISTTIMEFORMAT variable for the current user. This will remain in effect until the next restart.
# export HISTTIMEFORMAT='%F% T 'method 2: add the HISTTIMEFORMAT variable to the .bashrc or .bash _ profile file to make it permanent.
# echo 'HISTTIMEFORMAT= "% F% T" > ~ / .bashrc or # echo' HISTTIMEFORMAT= "% F% T" > ~ / .bash_profile run the following command to make the changes in the file take effect.
# source ~ / .bashrc or # source ~ / .bash_profile method 3: add the HISTTIMEFORMAT variable to the / etc/profile file and make it permanent for all users.
# echo 'HISTTIMEFORMAT= "% F% T" > / etc/profile run the following command to make the changes in the file take effect.
# the output result of source / etc/profile is:
# history 1 2017-08-16 15:30:15 yum install-y mysql-server mysql-client 2 2017-08-16 15:30:15 service mysqld start 3 2017-08-16 15:30:15 sysdig proc.name=sshd 4 2017-08-16 15:30:15 sysdig-c topprocs_net 5 2017-08-16 15:30:15 sysdig proc.name=sshd 6 2017-08-16 15:30:15 sysdig proc.name=sshd | more 7 2017-08-16 15:30:15 sysdig fd.name=/var/log / auth.log | more 8 2017-08-16 15:30:15 sysdig fd.name=/var/log/mysqld.log 9 2017-08-16 15:30:15 sysdig-cl 10 2017-08-16 15:30:15 sysdig-I httplog 11 2017-08-16 15:30:15 sysdig-I proc_exec_time 12 2017-08-16 15:30:15 sysdig-I topprocs_cpu 13 2017-08-16 15:30:15 sysdig-c topprocs_cpu 14 2017-08-16 15:30 : 15 sysdig-c tracers_2_statsd 15 2017-08-16 15:30:15 sysdig-c topfiles_bytes 16 2017-08-16 15:30:15 sysdig-c topprocs_cpu 17 2017-08-16 15:30:15 sysdig-c topprocs_cpu "fd.name contains sshd" 18 2017-08-16 15:30:15 sysdig-c topprocs_cpu "proc.name contains sshd" 19 2017-08-16 15:30:15 csysdig 20 2017-08-16 15:30:15 sysdig-c Topprocs_cpu 21 2017-08-16 15:30:15 rpm-- import https://s3.amazonaws.com/download.draios.com/DRAIOS-GPG-KEY.public 22 2017-08-16 15:30:15 curl-s-o / etc/yum.repos.d/draios.repo http://download.draios.com/stable/rpm/draios.repo 23 2017-08-16 15:30:15 yum install-y epel-release 24 2017-08-16 15:30:15 yum update 25 2017- 08-16 15:30:15 yum makecache 26 2017-08-16 15:30:15 yum-y install kernel-devel-$ (uname-r) 27 2017-08-16 15:30:15 yum-y install sysdig 28 2017-08-16 15:30:15 sysdig 29 2017-08-16 15:30:15 yum install httpd mysql 30 2017-08-16 15:30:15 service httpd start on how to use the Linux system history command display time is here I hope that the above content will enable you to improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.