Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top