qnd:bash_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
qnd:bash_configuration [2023/01/31 14:07] mguptonqnd:bash_configuration [2023/03/31 11:34] (current) mgupton
Line 8: Line 8:
 # #
 shopt -s histverify shopt -s histverify
-export HISTIGNORE="history*:[ \tbf]g*:hh:jobs:fc:clear:man *"+# Exclude things from being saved in history 
 +export HISTIGNORE="history*:[ \tbf]g*:hh:hs:jobs:fc:clear:man *"
 # Prevent duplicate entries # Prevent duplicate entries
 export HISTCONTROL=ignoreboth:erasedups export HISTCONTROL=ignoreboth:erasedups
Line 38: Line 39:
 alias nn='nano' alias nn='nano'
 alias ha='history -a' alias ha='history -a'
 +alias hs='history -s'
 </code> </code>
  
Line 44: Line 46:
 # Handle saving history with multiple shells # Handle saving history with multiple shells
 # After each command, append to the history file and reread it # After each command, append to the history file and reread it
 +# Ref: https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows
 PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
 </code> </code>
  • qnd/bash_configuration.1675174026.txt.gz
  • Last modified: 2023/01/31 14:07
  • by mgupton