Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

Reloading /etc/profile - how to reload Unix /etc/profile
Page 1 of 1

Author:  mandrei99 [ Tue Jan 20, 2015 5:29 pm ]
Post subject:  Reloading /etc/profile - how to reload Unix /etc/profile

Reloading profile, Reloading profile under Unix, Reloading profile under Linux,Reloading profile under BSD, how to reload Unix profile.

Use the following command to reload a unix profile (/etc/profile, ~/.profile, ~/.bash_profile ...):

$ . ~/.profile
$ . /etc/profile

Notice: . (dot) is a command that originates from source command. On some unix flavours (FreeBSD 6 for example) source command works still:

$ source ~/.profile
$ source /etc/profile

.profile settings overwrite those in /etc/profile. You can also use .bash_profile in your home directory to customize your bash shell's profile.
Basically, if you need to load shell variables from any file just run the . (dot) command, followed by space and (the absolute path is necessary) the path to the file. (Be carefull what file you're loading variables from because you meight overwrite some important environment variables and your system could become unstable).

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group