Life saving Bash Settings

I saw this settings on a tweet flood. I did not want to lose them. I copied all of content in here. Thanks @kadirsert 

If you are continuously running shell commands on more than one Linux terminal, probably you want all of the shell (mostly bash) prompts to remember any command from any terminal.

With the following environmental variables to in the .bashrc file, you can do it so

Ignoring duplicate entries: 
export HISTCONTROL=ignoredups:erasedups

large history size:
export HISTSIZE=102400

This is for a big history file:
export HISTFILESIZE=100000

Appending commands to history file:
shopt -s histappend

Last but not least, this is for saving and reloading the history after each command is run:
export PROMPT_COMMAND=“history -a; history -c; history -r; $PROMPT_COMMAND”


5 Şubat 2019

Posted In: bash, bashrc, linux, shell

WP Twitter Auto Publish Powered By :