0
0

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を整える

Last updated at Posted at 2019-12-07

現在のPATHを確認

再設定の際に使うのでPATHを整形して控えておく。

$ echo $PATH
 /home/yourname/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:

PATHを消す

unset PATH

新しいPATHを通す

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

永続化

ターミナルで実行しただけだとその実行したターミナル内でしか有効にならないので~/.bashrc等に記述する。

~/.bashrc
export PATH=$PATH:/usr/local/bin/:/usr/bin/
更新
source ~/.bashrc
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?