LoginSignup
69

More than 3 years have passed since last update.

posted at

updated at

MacのTerminalの環境変数をブッ壊したときの対処法

slコマンド(蒸気機関車のやつ)をOS Xのzshに入れようとしたのですが,

export $PATH=/Users/keisei/sl/

とかいうことをやらかしました.
全てのコマンドがここを参照するようになってしまうんですね…(知識不足)

ということでこれでターミナルがCommand not found祭りになった場合の対処ですが,ターミナル上で

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

とりあえずこれを打てば復活します..bash_profile .zshrc などをテキストエディタで編集しましょう.


参考 PATHを設定する

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
69