user2060827
user2060827

Reputation:

PATH variable in linux

I was in need of setting a PATH in terminal. I tried ;

export PATH=/usr/local/sample

it seems ok. but after that I lost another paths i set previously. What is the issue?

Upvotes: 1

Views: 1069

Answers (2)

user2166576
user2166576

Reputation:

You should add PATH like this :

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

appending $PATH will add the current values set in the PATH.

Upvotes: 2

bash0r
bash0r

Reputation: 635

Do it like this: export PATH=$PATH:/usr/local/sample

You assigned PATH a new value (PATH = VALUE). What you wanted was to add a new value to PATH (PATH = PATH + VALUE).

Upvotes: 1

Related Questions