Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
qnd:bash_configuration [2022/03/04 21:33] – mgupton | qnd:bash_configuration [2023/03/31 11:34] (current) – mgupton | ||
---|---|---|---|
Line 8: | Line 8: | ||
# | # | ||
shopt -s histverify | shopt -s histverify | ||
- | export HISTIGNORE=" | + | # Exclude things from being saved in history |
+ | export HISTIGNORE=" | ||
+ | # Prevent duplicate entries | ||
export HISTCONTROL=ignoreboth: | export HISTCONTROL=ignoreboth: | ||
+ | # When the shell exits, append to the history file instead of overwriting it | ||
+ | shopt -s histappend | ||
+ | # Add date-time stamp for commands in history output | ||
+ | export HISTTIMEFORMAT=" | ||
+ | # | ||
+ | # Add current line to history without executing it. | ||
+ | # | ||
+ | bind '" | ||
# | # | ||
# Bind the keyboard combination Alt + h to displaying the command history. | # Bind the keyboard combination Alt + h to displaying the command history. | ||
# | # | ||
- | bind '" | + | # bind '" |
- | bind '" | + | bind -x '" |
+ | # bind '" | ||
+ | bind -x '" | ||
# | # | ||
# Disable flow control, so Ctrl + s can be used for forward searches in history to go with reverse searches (Ctrl + r) | # Disable flow control, so Ctrl + s can be used for forward searches in history to go with reverse searches (Ctrl + r) | ||
Line 21: | Line 33: | ||
stty -ixon | stty -ixon | ||
- | alias ls='ls -haltr --color | + | alias ll='ls -haltr --color' |
alias grep=' | alias grep=' | ||
alias hh=' | alias hh=' | ||
alias hg=' | alias hg=' | ||
alias nn=' | alias nn=' | ||
+ | alias ha=' | ||
+ | alias hs=' | ||
</ | </ | ||
<code bash> | <code bash> | ||
- | # Avoid duplicates | ||
- | HISTCONTROL=ignoredups: | ||
- | # When the shell exits, append to the history file instead of overwriting it | ||
- | shopt -s histappend | ||
- | |||
# 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:// | ||
PROMPT_COMMAND=" | PROMPT_COMMAND=" | ||
</ | </ |