Skip to content

Instantly share code, notes, and snippets.

Created Jan 31, 2022
What would you like to do?
Bash history settings to tweak for infinite history, instant appending of commands, and shared history across multiple terminals.
# By Pete Warden, @petewarden
# To use this, open ~/.bashrc in your editor of choice,
# and place these settings at the end.
# Based on and
# Ignore both duplicate commands, and those that start with a space.
# Append to the history file, don't overwrite it.
shopt -s histappend
# Make the maximum size of the history file enormous.
# This makes the entries easy to sort by time.
# Store each command in the history immediately, not on session close.
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment