-
Notifications
You must be signed in to change notification settings - Fork 2
/
history.sh
35 lines (28 loc) · 961 Bytes
/
history.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -------------------------------------------------------
# Original Author: Nathan Broadbent
# Modified By: Michael-Keith Bernard
# Source: https://github.com/ndbroadbent/ubuntu_config
# Retrieved: Oct 19, 2011
# -------------------------------------------------------
# -------------------------------------------------------
# Share Bash history across sessions
# -------------------------------------------------------
# append to the history file, don't overwrite it
shopt -s histappend
export HISTSIZE=20000
export HISTFILESIZE=$HISTSIZE
# don't put duplicate lines in the history,
# ignore lines starting with a space
export HISTCONTROL=ignoredups:ignorespace
# ignore some common commands
export HISTIGNORE="&:ls:ll:gs:gd:[bf]g:exit:pwd:clear:mount:umount"
history() {
_bash_history_sync
builtin history $@
}
_bash_history_sync() {
builtin history -a
builtin history -c
builtin history -r
}
export PROMPT_COMMAND+='_bash_history_sync;'