Home >System Tutorial >LINUX >How to make the Linux history command display the date in front?
In the Linux system, if you want to display the date in front of the history, how to set it up? We can configure it in the user's .bashrc file. After the application takes effect, the date can be displayed in front of the history command. Please see the detailed introduction below.
1. For systems using Ubuntu Linux, you can right-click on the desktop and "
Open Terminal".
2. Use the following command to open the .
bashrc file.
$sudo gedit ~/.bashrc
3. We will open such a bashrc file window.
4. At the end we add
export HISTTIMEFORMAT=" %F %T "Or you can also use export HISTTIMEFORMAT=" [%Y.%m.%d %H:%M:%S] ”
5. Then we use the
source command to take effect, or you can also reopen the terminal window.
$source ~/.bashrc
6. Now we can use the history command in the terminal to display the date in front.
Note: is the date calculated from the time of configuration.
The above is the detailed content of How to make the Linux history command display the date in front?. For more information, please follow other related articles on the PHP Chinese website!