I'm using solaris 10 vm box, every time I login or open new terminal my PATH variable is getting reset to default, I'm using export PATH=XXX command to set my path. When I tried to change the content in /etc/skel/local.profile file changes are not getting accepted even after I set them to 777 with chmod, same when I tried to change the login file in /etc/default, and there is no file or directory named environment in /etc/ directory currently my shell shows bash. Can someone help to permanently change the PATH variable without setting it for every session?
Asked
Active
Viewed 4,665 times
1
-
Possible duplicate of [How to permanently set $PATH on Linux?](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux) – Andrew Henle Aug 30 '17 at 09:54
1 Answers
1
The /etc/skel
folder is only used when you create a new user, its content is copied to the new user's home folder.
If you want to change the PATH
variable everytime you login to your account, then add the following to the .profile
file in your home folder (create it if it doesn't already exist):
export PATH=$PATH:/some/new/path

Greg Depoire-Ferrer
- 192
- 1
- 6
-
@Pavanisivadath have you tried logged out and logged in again (not just starting a terminal)? if it doesn't work try putting the line in `.bash_profile` in your home folder. – Greg Depoire-Ferrer Aug 30 '17 at 12:39
-
yes I've logged out and logged in again .there is no such file in my home directory. – Pavani siva dath Sep 01 '17 at 05:20
-
This answer is correct and works perfectly, thanks so much @GregDepoire-Ferrer ! :) – Ice Phoenix Feb 05 '19 at 00:15