1

How to set History Display Date And Time For Each Command

I need to set the date and time for each command while using history. how to set the time and date for history command

jacob
asked Dec 19, 2019
edited
1 Answer
2

Use the following command to set the date and time

echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bash_profile

Then run the following command to set the environment

source ~/.bash_profile

Now run the command

history

    1  12/12/19 17:21:34 cd
    2  12/12/19 17:21:34 add-apt-repository ppa:openshot.developers/ppa
    3  12/12/19 17:21:34 ping google.com
    4  12/12/19 17:21:34 ip a
    5  12/12/19 17:21:34 systemctl restart network
View More
linuxhelp
answered Dec 19, 2019
Your Answer
||||
x
 
100:0

Related Tutorials in How to set History Display Date And Time For Each Command

Related Tutorials in How to set History Display Date And Time For Each Command