環境を新しく作成したときに、履歴を活用する設定をします。
dockerを立ち上げる場合などはとても便利です。
csh/tcsh
今(2019.06.03)、FreeBSDではcshとtcshはハードリンクになっています。
実体は同じですが、tcshを使うとして説明します。
(Ubuntu 18.04.2でsudo apt-get install tcshとすると、csh -> tcshになります。)
~/.tcshrcに下記を記述します。
~/.tcshrc
bindkey -k up history-search-backward
bindkey -k down history-search-forward
history関連で.tcshrcに対する設定は下記のようにします。
~/.tcshrc
set histfile = ~/.tcsh_history
set history = 8192
set savehist = (65536 merge)
“savehist merge”で検索すると、色々と問題があった歴史がわかります。自分で積極的にhistoryを保存する仕組みを作った方が安全です。
bash
~/.inputrcに以下の行を追加します。
~/.inputrc
"\e[A":history-search-backward
"\e[B":history-search-forward
history関連で.bashrc(または.bash_profile)に対する設定は下記のようにします。
~/.bashrc
HISTSIZE=8192
export HISTSIZE
HISTFILESIZE=65536
export HISTFILESIZE
historyの保存
tcshの場合は下記で、~/.tcsh_historyを更新できます。
history -S
bashの場合は下記で、~/.bash_historyを更新できます。
history -a
history -w
手順書を作成することがわかっている場合は、下記で残しておくという簡単な方法も有効です。
作業を開始
作業が完了
history > history_docker_redmine_git_2019_06_01
cp ~/.tcsh_history tcsh_history_docker_redmine_git_2019_06_01
他、下記の方法があります。
script
作業を開始
作業が完了
exit
cp typescript manual_docker_redmine_git
参考
広告
IT開発関連書とビジネス書が豊富な翔泳社の通販『SEshop』
さくらのレンタルサーバ

ムームードメイン

Oisix(おいしっくす)

らでぃっしゅぼーや

珈琲きゃろっと

エプソムソルト
