参考にさせていただきました
$ emacs .bashrc
# historyに記憶するコマンド数 HISTSIZE=5000 # historyなどの履歴を保存しない HISTIGNORE="fg*:bg*:history*:h*" # historyに時間を追加 HISTTIMEFORMAT='%Y.%m.%d %T '
# 別タブの履歴を保存する function share_history { history -a history -c history -r } PROMPT_COMMAND='share_history'
# ignorespace 先頭スペースのコマンドは記録しない # ignoredups 連続したコマンドは記録しない # ignorespace+ignoredups = ignoreboth export HISTCONTROL=ignoreboth
有効化
[shell]
$ source ~/.bashrc
[/shell]
こういうブログもありました。
- bashのhistoryをタブ間で共有したり、増やしたり
- 僕のプロンプトの設定(Ubuntu & bash)
- MacのopenコマンドをUbuntuで
- Mac OS Xのターミナルで、起動時に.bashrcを自動で読み込む
- コマンドライン rmを削除->ゴミ箱に変更