Linux – Where is the $HOME environment variable set

environment-variableslinux

I'm looking for the place where $HOME environment variable set.
It is after login, to my mind.

I'm using Linux debian 2.6.32-5-686.

Best Answer

If you are attempting to modify your HOME, you can do

export HOME=/home/... 

either in your shell, or in your ~/.profile file and/or ~/.bashrc (or appropriate login shell).

(The above code will work for bash and similar shells, which are default in Debian; you would otherwise do `setenv HOME $HOME:/extra/path I think on csh-like shells in other distros.)

edit -- However this is probably not the way to do it. See other answers. Do not use this answer.

Related Question