41
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PATHの変更でcommand not foundになってしまった場合の直し方

Posted at

.bash_profileに変なPATHを間違えて設定してしまい、
ほとんどのコマンドがcommand not foundになってしまって、
めちゃくちゃ焦ったのでその時の対処メモ。

スマートな直し方では無いかもしれませんが。。

##解決方法

とりあえず、まずはコマンドを使えるようにするためにPATHを設定

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

それから

$ vi ~/.bash_profile

で間違えて設定したPATHを削除

これで直りました。

##参考

41
33
2

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
  3. You can use dark theme
What you can do with signing up
41
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?