bash.rst
changeset 221 97171c12b447
parent 27 99584256fa88
child 276 ed6b5ae36a49
equal deleted inserted replaced
218:9ae36e91b0d0 221:97171c12b447
     6 
     6 
     7 Put at end of these files
     7 Put at end of these files
     8 
     8 
     9   PS1='\u@\H$ '
     9   PS1='\u@\H$ '
    10 
    10 
    11 When xterm start bash - it start as nonlogin. 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 readed.
    16 That make bash interactive and init file read.
       
    17 
       
    18 * Command history.
       
    19 
       
    20 Bash allow accessing to command that you type previously. There are exist
       
    21 several options to control command history behavior. Set corresponding
       
    22 variables in your ~/.bashrc file (which is read by interactive shell):
       
    23 
       
    24   #   ignorespace do not save lines that start with space
       
    25   #   erasedups all previous lines matching the current line to be removed from
       
    26   #             the history list before that line is saved
       
    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*"
       
    29 
       
    30 There are another options, with default values (which satisfy my neediness, so
       
    31 I don't put they to ~/.bashrc):
       
    32 
       
    33   export HISTFILE=~/.bash_history  # where is command history stored
       
    34   export HISTFILESIZE=500          # how many lines been in $HISTFILE
       
    35   export HISTSIZE=500              # how many lines been stored in bash process
       
    36 
       
    37 ** mc (GNU Midnight Commander).
       
    38 
       
    39 You can also set special history rules for mc subshell in ~/.mc/bashrc file.