Skip to content

Instantly share code, notes, and snippets.

@fduran
Last active October 18, 2022 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fduran/1870477 to your computer and use it in GitHub Desktop.
Save fduran/1870477 to your computer and use it in GitHub Desktop.
Linux better command history
# better command line history: more commands kept, aggregate, add timestamp
# www.fduran.com
# add in /etc/profile
shopt -s histappend
HISTSIZE=10000
HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S "
HISTCONTROL=ignoredups
PROMPT_COMMAND="history -a;history -c;history -r;$PROMPT_COMMAND"
# see 'date' formats for other timestamp formats
# test after logging in:
history |less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment