bash.rst
changeset 278 a58e223b692f
parent 277 5c7e19c15332
child 735 5c437e2d5fe1
equal deleted inserted replaced
273:47bd3ab92f6f 278:a58e223b692f
    11 When xterm start bash - it start as non-login. So ~/.bash_profile and ~/.bashrc
    11 When xterm start bash - it start as non-login. So ~/.bash_profile and ~/.bashrc
    12 didn't read. To workaround this use
    12 didn't read. To workaround this use
    13 
    13 
    14   $ xterm -e bash -i -c "mc -x"
    14   $ xterm -e bash -i -c "mc -x"
    15 
    15 
    16 That make bash interactive and init file read.
    16 That make bash interactive and init file was readed.
    17 
    17 
    18 * Command history.
    18 * Command history.
    19 
    19 
    20 Bash allow accessing to command that you type previously. There are exist
    20 Bash allow accessing to command that you type previously. There are several
    21 several options to control command history behavior. Set corresponding
    21 options to control command history behavior. Set corresponding variables in
    22 variables in your ~/.bashrc file (which is read by interactive shell):
    22 your ~/.bashrc file (which is read by interactive shell):
    23 
    23 
    24   #   ignorespace do not save lines that start with space
    24   #   ignorespace do not save lines that start with space
    25   #   erasedups all previous lines matching the current line to be removed from
    25   #   erasedups all previous lines matching the current line to be removed from
    26   #             the history list before that line is saved
    26   #             the history list before that line is saved
    27   export HISTCONTROL=igrorespace:erasedups
    27   export HISTCONTROL=igrorespace:erasedups
    28   export HISTIGNORE=" ?cd *":"e *":"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":ls:pwd:"vlc*"
    28   export HISTIGNORE=" ?cd *":"e *":"sudo mv *":"sudo rm *":"sudo cp *":"sudo mkdir *":"sudo chmod *":"sudo chown *":ls:pwd:"vlc*"
    29 
    29 
    30 There are another options, with default values (which satisfy my neediness, so
    30 There are another options, with default values (which satisfy my needs, so
    31 I don't put they to ~/.bashrc):
    31 I don't put they to ~/.bashrc):
    32 
    32 
    33   export HISTFILE=~/.bash_history  # where is command history stored
    33   export HISTFILE=~/.bash_history  # where is command history stored
    34   export HISTFILESIZE=500          # how many lines been in $HISTFILE
    34   export HISTFILESIZE=500          # how many lines been in $HISTFILE
    35   export HISTSIZE=500              # how many lines been stored in bash process
    35   export HISTSIZE=500              # how many lines been stored in bash process