# HG changeset patch # User Oleksandr Gavenko # Date 1256647779 -7200 # Node ID 221500927a597f137ce848ed09361737214cec60 # Parent 97171c12b447d85f322ce300eabcb9084a7db499# Parent 10d0d94eabde00204c107a5077e5ddc47d905171 merged diff -r 10d0d94eabde -r 221500927a59 bash.rst --- a/bash.rst Fri Oct 16 12:15:04 2009 +0300 +++ b/bash.rst Tue Oct 27 14:49:39 2009 +0200 @@ -8,9 +8,32 @@ PS1='\u@\H$ ' -When xterm start bash - it start as nonlogin. So ~/.bash_profile and ~/.bashrc +When xterm start bash - it start as non-login. So ~/.bash_profile and ~/.bashrc didn't read. To workaround this use $ xterm -e bash -i -c "mc -x" -That make bash interactive and init file readed. +That make bash interactive and init file read. + +* Command history. + +Bash allow accessing to command that you type previously. There are exist +several options to control command history behavior. Set corresponding +variables in your ~/.bashrc file (which is read by interactive shell): + + # ignorespace do not save lines that start with space + # erasedups all previous lines matching the current line to be removed from + # the history list before that line is saved + export HISTCONTROL=igrorespace:erasedups + export HISTIGNORE=" ?cd *":"e *":"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":ls:pwd:"vlc*" + +There are another options, with default values (which satisfy my neediness, so +I don't put they to ~/.bashrc): + + export HISTFILE=~/.bash_history # where is command history stored + export HISTFILESIZE=500 # how many lines been in $HISTFILE + export HISTSIZE=500 # how many lines been stored in bash process + +** mc (GNU Midnight Commander). + +You can also set special history rules for mc subshell in ~/.mc/bashrc file.