History displays the time information

简介: For those of you who use terminals a lot, one of the most common commands is probably history, which allows you to view the history of terminal commands executed

history 执行很简单:如下:参考

pi@raspberrypi:~ $ history

1  clear
2  ls
3  sudo apt update
4  df -h
5  sudo apt install vim
6  sudo reboot
7  clear
8  ls
9  sudo apt install vim

10 locale

Sometimes, however, we want to get more historical information, such as the time when a command was executed, to determine some actions.

针对 bash 这样设置

echo 'HISTTIMEFORMAT="%F %T "' >> ~/.bashrc
source ~/.bashrc

然后再次执行
history

1  2022-02-06 21:55:32 clear
2  2022-02-06 21:55:32 ls
3  2022-02-06 21:55:32 sudo apt update
4  2022-02-06 21:55:32 df -h
5  2022-02-06 21:55:32 sudo apt install vim
6  2022-02-06 21:55:32 sudo reboot
7  2022-02-06 21:55:32 clear
8  2022-02-06 21:55:32 ls
9  2022-02-06 21:55:32 sudo apt install vim

10 2022-02-06 21:55:32 locale

However, for terminals that use the ZSH environment (such as OHmyzsh), the above configuration does not take effect, and history-i is required

history -i

1  2020-07-05 16:48  mv ~/Downloads/aaaaa.zip ./
2  2020-07-05 16:48  unzip aaaaa.zip
3  2020-07-03 21:58  export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087;
4  2020-07-03 21:58  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
5  2020-07-03 22:10  sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
6  2020-07-03 22:13  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"\n
7  2020-07-03 22:44  cd OneDrive





目录
相关文章
|
4月前
|
Oracle 关系型数据库 数据库
Active Data Guard Real-Time Cascade
12c 的 Cascaded Standby 数据库
49 7
|
Java 关系型数据库 MySQL
The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must c
报错信息如下:The server time zone value ‘?й???’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
92 0
|
6月前
|
Java 数据库连接 数据库
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
The server time zone value ‘Öйú±ê׼ʱ¼ä‘ is unrecognized or represents more than one time zone
38 0
|
关系型数据库 MySQL Java
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
超详解The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents more than one time zone
712 0
有趣的 events_statements_current 表问题
有趣的 events_statements_current 表问题
154 0
|
关系型数据库 MySQL Java
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
91 0
The server time zone value '?й???????' is unrecognized or represents more than one time zone.
《Fighting Cybercrime A Joint Task Force of Real-Time Data and Human Analytics》电子版地址
Fighting Cybercrime: A Joint Task Force of Real-Time Data and Human Analytics
84 0
《Fighting Cybercrime A Joint Task Force of Real-Time Data and Human Analytics》电子版地址
|
容器 安全 物联网
Speed Matters: How To Process Big Data Securely For Real-time Applications
Big Data processing has stepped up to provide organizations with new tools and technologies to improve business efficiency and competitive advantage.
1308 0
Speed Matters: How To Process Big Data Securely For Real-time Applications
|
传感器 关系型数据库 PostgreSQL
Real-time Monitoring and Alerts for Senior Citizens - Big Data for Healthcare
This article discusses Alibaba Cloud PostgreSQL best practices for healthcare applications. In particular, we will explore how Big Data can be applied.
2510 0
Real-time Monitoring and Alerts for Senior Citizens - Big Data for Healthcare
|
关系型数据库 测试技术 Oracle
[20180102]statistics_level=BASIC.txt
[20180102]statistics_level=BASIC.txt --//一个测试环境不知道谁设置statistics_level=BASIC,导致重启出现错误,自己在测试环境模拟看看: SYS@book> create pfile='/tmp/@.
1252 0