Last active
October 18, 2022 20:12
-
-
Save fduran/1870477 to your computer and use it in GitHub Desktop.
Linux better command history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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