Reputation: 7590
I've modified the .profile file of a user. It contains some new environement vars, how can i reload this file without restarting the server ?
The .profile file is only charged when the system boots or in any other case ??
Thanks in advance.
Upvotes: 1
Views: 2957
Reputation: 157927
Normally the file gets parsed on startup of a new shell (not at system boot!). So you can just start another shell and your changes to ~/.profile
will be present. However, you can also "source" the file in the current shell session:
source ~/.profile
Note that source
is just human readable shortcut for the .
command. So, you can also issue
. ~/.profile
Thanks to @chepner for explaining that source
is an alias of .
and not vise versa.
Upvotes: 5
Reputation: 26164
You can do it like this:
$ . ~/.profile
This is doing the same as:
$ source ~/.profile
The file will be executed (interpreted) by the current shell, all changes to environment variables will affect your current session.
Upvotes: 2