• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Bash History With Timestamps

October 31, 2019

If you need to see Bash history with timestamps, use this command.

HISTTIMEFORMAT="%d/%m/%y %T "

HISTTIMEFORMAT="%d/%m/%y %T "

To make it permanent, add it to your .bashrc.

echo 'HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc
source ~/.bashrc

echo 'HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc source ~/.bashrc

Timestamps accuracy is retroactively, meaning it will not be accurate for commands performed prior to the history time format being set.

Filed Under: Linux Tagged With: bash, bashrc, history, timestamps

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023