LoginSignup
2
0

More than 1 year has passed since last update.

Linux(ubuntu)でPATHを編集する方法

Last updated at Posted at 2023-03-03

ググれば簡単に見つかるだろうと思ったのですが、関数を使ったりとかの複雑な方法ばかりだったし、少なくとも、私の環境では機能しなかったので、予想以上に苦労した。
備忘録的に記載します。

最終的には、下記サイトが参考になった。
とてもシンプル。
https://blog.s-giken.net/445.html

PATHの追加はこれ。

$ echo $PATH
/usr/local/bin:/usr/bin:/bin
 
$ PATH=$PATH:/home/bin
 
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/home/bin

PATHの上書きはこれ。 上書きすると、前のは全部消えます。

$ PATH=/home/bin
 
$ echo $PATH
/home/bin

ちなみに、上だけだと再起動すると消えます。
PATHを永続化させたいなら、~/.profileファイルに書き込む必要があります。

https://www.motokis-brain.com/article/122
https://docs.datastax.com/ja/install/6.0/install/installJdkDeb.html

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