Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 507 Bytes

DRAFT-bash-history.md

File metadata and controls

25 lines (18 loc) · 507 Bytes

Control what goes into history

HISTIGNORE='exit:history:l:l[1als]:lla:+(.)'
HISTCONTROL='ignoreboth'

Control how commands are stored in history

shopt -s cmdhist
shopt -s lithist
HISTTIMEFORMAT='%F %T '

Combine history from different shell sessions

PROMPT_COMMAND="history -a; history -c; history -r${PROMPT_COMMAND:+$'\n'"$PROMPT_COMMAND"}"

References