bash.rst
changeset 277 5c7e19c15332
parent 276 ed6b5ae36a49
child 735 5c437e2d5fe1
equal deleted inserted replaced
276:ed6b5ae36a49 277:5c7e19c15332
    15 
    15 
    16 That make bash interactive and init file was readed.
    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