Skip to content

Instantly share code, notes, and snippets.

@grantpullen
Created October 18, 2018 11:27
Show Gist options
  • Save grantpullen/476dbef89e89138fd1e556fc215c582d to your computer and use it in GitHub Desktop.
Save grantpullen/476dbef89e89138fd1e556fc215c582d to your computer and use it in GitHub Desktop.
Bash history with multiple terminals open saved.
# Add line below to /root/.bashrc or required acconut under /home/user/.bashrc
export HISTSIZE=50000
# Maximum number of history lines on disk
export HISTFILESIZE=50000
# After each command, append to the history file
# and reread it
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment