[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: show command time in history
From: |
Jostein Berntsen |
Subject: |
Re: show command time in history |
Date: |
Tue, 28 Jan 2020 10:30:41 +0100 |
User-agent: |
Mutt/1.13.3 (2020-01-12) |
On 27.01.20,22:20, Peng Yu wrote:
> Hi,
>
> I'd like to show the time when the command was run in history. The
> `history` command does not show this info. Is there a way to do so in
> bash? Thanks.
>
Hi,
You can update the HISTTIMEFORMAT environment variable with time
parameters like this:
echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile
source ~/.bash_profile
The output of 'history' will then show the command time.
Jostein