Skip to content

Instantly share code, notes, and snippets.

@shamil
Last active December 30, 2015 21:59
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 shamil/7890825 to your computer and use it in GitHub Desktop.
Save shamil/7890825 to your computer and use it in GitHub Desktop.

put that into .bashrc:

export HISTFILESIZE=
export HISTSIZE=

There you go, unlimited history :)

From "man bash":

If HIST‐FILESIZE is not set, no truncation is performed.
That means .bash_history is never truncated

Also the same seems to apply to HISTSIZE, although I couldn't find that documented.

Another neat feature:

If the HISTTIMEFORMAT variable is set, time stamps are written to the history file, marked with the history comment character, so they may be preserved across shell sessions.

Let me know if you have tried that already...

export HISTTIMEFORMAT='%F %T '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment