logoalt Hacker News

bertmuthalaly06/24/20254 repliesview on HN

When you’re debugging, especially a complex system, especially during an outage or postmortem, understanding when your commands executed relative to when your log lines appeared is really helpful.


Replies

xorcist06/24/2025

That's a good reason to have timestamps in the history, which you should.

Something like

  export HISTFILESIZE=
  export HISTSIZE=
  export HISTTIMEFORMAT="[%F %T] "
  shopt -s histappend
really ought to be default in bash.

It's not as clear why you need it in the interactive prompt.

show 1 reply
kccqzy06/24/2025

That's a poor and hacky substitute of using Linux audit features. It's perhaps the right robustness/complexity trade off for my personal machine, but for work they likely already have audit features turned on and you can access the timing from there.

show 1 reply
styluss06/24/2025

sounds like your describing https://linux.die.net/man/1/ts

bayindirh06/24/2025

Oh, that's an interesting use case, alright.