Current location - Music Encyclopedia - Chinese History - Linux history can view the commands that have been executed in the history. How to check the command execution time?
Linux history can view the commands that have been executed in the history. How to check the command execution time?
Answer: linux bash internal command history can display the command history of the command line and the execution history of the default environment.

After a command, usually only the serial number of the executed command and the command itself are displayed.

If you want to view the timestamp of the command history, you can execute:

# export HISTTIMEFORMAT='%F %T '

# History | More

Service network restart

19:02:39 exit

identity card

The format of the display changes to serial number-time-command line.

Other basic functions of history:

1. Use HISTSIZE to control the total number of rows recorded by historical commands.

Append the following two lines to. Bash_profile file and log in to bash shell again, and the number of command histories will become 450.