export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export IFS=$' \t\n'
help fc
help history
help bind
help set
help shopt
open /usr/share/doc/bash/builtins.pdf
cp -ip ~/.bashrc ~/.bashrc.orig
cp -ip ~/.inputrc ~/.inputrc.orig
cp -ip ~/.bash_history ~/.bash_history.bak
cp -ip ~/.bashrc{,.orig}
cp -ip ~/.inputrc{,.orig}
cp -ip ~/.bash_history{,.bak}
history
history | head -n 3
history | tail -n 1
history | egrep 5
history | egrep '^[[:space:]]*5'
history | egrep -m 1 '^[[:space:]]*5'
history | egrep '^[[:space:]]*5[[:space:]]+'
fc
fc -e nano
fc -l | nl
fc -ln | sed 's/^[[:space:]]*//'
fc -l 0
fc -l 1 -1
fc -l -1
fc -l -5
fc -l 5 "cd "
fc -l -r 5 "cd "
fc -l -5 | grep cd | awk '{print $1}'
fc -s cd
fc -e vim 3
fc -e nano "cd "
set +o history
set -o history
/bin/cat >> ~/.bashrc <<-'EOF'
bind Space:magic-space # enable option to expand & edit a command before running it by entering a [space]
#shopt -s histverify # expand & edit a command before running it by entering [return]
shopt -s cmdhist
shopt -s histappend
# suppress history recording for the specified commands including commands beginning with a space
export HISTIGNORE="&:[ \t]*:ls:[bf]g:history*:clear:exit"
#export HISTCONTROL=ignorespace
#export HISTCONTROL=ignoredups
#export HISTCONTROL=ignoreboth
#PROMPT_COMMAND="history -a; ${PROMPT_COMMAND}"
EOF
source ~/.bashrc
/bin/cat >> ~/.inputrc <<-'EOF'
"\033[3~": delete-char # get a proper forward delete key in Terminal.app
"\e[A": history-search-backward # search command history backward with up arrow key
"\e[B": history-search-forward # search command history forward with down arrow key
set show-all-if-ambiguous on # enable tab completion with a single tab
set mark-symlinked-directories on
set completion-ignore-case on
#set visible-stats on
#set bell-style visible
#$if Bash # same effect as "bind Space:magic-space" in ~/.bashrc
EOF
exec /bin/bash
source ~/.bash_login ~/.bashrc
help bind
bind -l | less
bind -P | less
bind -p | less
bind -V | less
bind -v | less
echo hello world1
echo hello world1 and world2
echo hello world1 and world2 and world3
echo hello
echo
[esc-.]
[ctrl-u]
echo !$
printf "%s\n" $_
!1[space]
!12[space]
sudo !![space]
!-4[space]
!cd[space]
!?world?[space]
!$[space]
!:1[space]
!-1:1[space]
!-1:1-[space]
!-1:1*[space]
!-1:1-$[space]
!-2:3[space]
abc def !#[space]
cd ~/Desktop
!cd:p
!cd[space]
[ctrl-u]
!?cd?:p
history | tail -n 1
cd[up_key]
cp[up_key]
cp[down_key]
[ctrl-r]cp
[esc] or [ctrl-j]
[ctrl-k] + [ctrl-u]
[ctrl-y]
cp foo !
cp -i foo !
cp -p -i foo !
cp !
cp foo !
cp -i foo !
echo abc def !#$.bak[space]
echo abc def !#$.bak ghi jkl !