How to restore .bashrc file?

In Ubuntu, there is a default version of the .bashrc file in the /etc/skel/ directory, so if you have problems with it you can restore it.

To do so follow the next steps:

1. Backup your current .bashrc file:

    cp ~/.bashrc ~/.bashrc.bak

2. Copy the skeleton .bashrc file over yours:

    cp /etc/skel/.bashrc ~/

3. Afterwards, load the new one:

    source ~/.bashrc

ソ-ス:bash - How to restore .bashrc file? - Ask Ubuntu


・ コマンド履歴に日付も付加
echo "HISTTIMEFORMAT='%F %T '"    >> .bashrc

・ ヒストリ無視パターンを設定する.
  cd とか ls とか ps とか top など3文字までのコマンド入力や exit はヒストリに残す価値なし.
echo "export HISTIGNORE='?:??:???:exit'" >> .bashrc