We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,627 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

how to set path permanently in linux

Hi,

I want to set path permanently in centos. I am able to set path, But when i logout and login the path is going.

Please tell me how to set path permanently

3
Contributors
2
Replies
20 Hours
Discussion Span
5 Months Ago
Last Updated
3
Views
chandbasha
Newbie Poster
22 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hello,

Depending on the shell you are running (probably bash) you set the path in your .bash_profile file. The file is in your home directory and you can add to the entries there:

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
rch1231
Veteran Poster
1,040 posts since Sep 2009
Reputation Points: 142
Solved Threads: 154
Skill Endorsements: 12

Or just:

export PATH=$HOME/bin:/usr/local/bin:${PATH}

This gives precidence to executable files in your personal bin directory, then to those in /usr/local/bin, and finally to the default PATH environment. Note the {} around PATH. That allows a recursive path definition like this, especially if the existing PATH environment is complexly defined. It is safer than not useing the curly braces.

rubberman
Posting Maven
2,571 posts since Mar 2010
Reputation Points: 365
Solved Threads: 305
Skill Endorsements: 51

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0638 seconds using 2.71MB