ゴミゴキブリ

技術ブログ

history -cが実行されないときの対処法

zshでhistory -cをすると以下の内容が出力される.

% history -c
history: bad option: -c

そういう仕様なのか知らんが,-cオプションが効かないっぽい. なのでzshrcに次のaliasを書く.

alias hc='rm -f ~/.zsh_history && exec -l $SHELL'

hcコマンドで履歴が全消去可能になった.