Discussion Locked

Environment Settings ie .profile

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How do you maintain the environment settings within unix, ie the PATH when using the set command". I have used set PATH=/usr/bin... export PATH, however when I logoff this is lost.

9 replies

by jandiar

To maintain common environment settings for all users, put them in /etc/environment or /etc/profile.

The first one is dedicated to set common environment variables, while the latter can contains more generic tasks such as check new mails.

by cavedweller

To modify a specific user's environment you can edit their .login, .cshrc and/or .profile. These files are located in their home (login) directory. Csh uses .cshrc, sh uses .profile.

It is usually a good idea to test new settings by entering the commands interactively but your observation is correct, they go away when you log out.

by dinesh_shimpi

Check for .profile file, in that file you have to mention the path for which you want to make changes permanently, It is obvious when you change the path,export path it will lost after that session finished, for this you have to made changes in .profile file only.

by oliviu

You get good answers.
One small observation (I hope you know this).
When adding a new directory to the PATH don't forget to add the $PATH variable like:

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

This discussion is closed to new replies.