LoginSignup
0
0

More than 3 years have passed since last update.

ターミナルで command not found が出た時の対処法

Posted at

ターミナルで command not found が出た時

AWSで環境構築を行い、本番環境にてsshでログインしようとした際...

$ ssh -i 秘密鍵.pem ec2-user@xxx.xxx.xx.xxx
-bash: ssh: command not found

と表示され、どんなコマンドを打っても効かない状態に....

原因はbash_profileをいじってしまっていた事でした

どうやら環境変数を設定していた時に、元々の記述を削除してしまったようです。

調べたところ、同じような失敗をしている方は少なくはないようでした

色々な解決方法はありますが、自分はこのコマンドを打った後に、普段通りターミナルを使用できるようになりました。

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

しかし、bash_profileで消してしまったパス自体が復元されている訳ではないので、毎回このコマンドを打たなければなりません:disappointed_relieved::disappointed_relieved::disappointed_relieved:

応急処置的な処理なので、、、

参考:
https://teratail.com/questions/100827

0
0
0

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
0
0