zsh 「history: bad option: -c」が発生した場合の対処法

  • 作成日 2022.11.13
  • zsh
zsh 「history: bad option: -c」が発生した場合の対処法

シェル「zsh」で、「history: bad option: -c」が発生した場合の対処法を記述してます。「bash」と違い「zsh」では「p」を使用します。

環境

  • OS macOS Monterey
  • SHELL /bin/zsh

エラー全文

「history -c」を実行時に発生

% history -c
history: bad option: -c

原因

「zsh」にはオプション「c」は存在しない

対処法

オプション「p」を使用する

% history -p