Hacker News new | ask | show | jobs
by pabs3 375 days ago
I recommend a few changes to these:

Infinite history instead of a large limit:

  HISTFILESIZE=-1
  HISTSIZE=-1
Also ignore commands starting with a space:

  HISTCONTROL=ignorespace:ignoredups:erasedups
Enable history substitution to verify commands before running them:

  shopt -s histverify
  shopt -s histreedit
Write commands to history files before running the commands instead of after the commands finish:

  trap 'history -a' DEBUG
Or if you already have a DEBUG trap:

  trap "history -a ; $(trap -p DEBUG | cut -d "'" -f 2)" DEBUG