Skip to content

Instantly share code, notes, and snippets.

@helix84
Forked from johntyree/long-history.sh
Created January 6, 2016 16:09
Show Gist options
  • Save helix84/21ecc8652ac9e340c6e9 to your computer and use it in GitHub Desktop.
Save helix84/21ecc8652ac9e340c6e9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Don't put duplicate lines in the history
export HISTCONTROL=ignoredups
# Store a lot history entries in a file for grep-age
shopt -s histappend
export HISTFILE=~/long_history
export HISTFILESIZE=50000
# No reason not to save a bunch in history
# Takes up several more MBs of RAM now, oOOOooh
export HISTSIZE=9999
# Ignore dupe commands and other ones you don't care about
export HISTIGNORE="&:[ ]*:exit"
# Up and down arrow to search
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment