2

I know the difference among ~/.bash, ~/.profile vs. /etc/profile. I know (please correct me if I am wrong) configuration in ~/.bash is applicable for a specific user and terminal only.Configuration in ~/.profile applicable for a user only.

But sometimes I found some configuration like environment variable are also set in /etc/environment file. What are the difference among these file?

I also found that in /etc/environment file we do not export environment variable while we export environment variable (like PATH) from ~/.bash and ~/.profile -

export JAVA_HOME=/usr/lib/java #for ~/.bash or ~/.profile  
JAVA_HOME=/usr/lib/java #for /etc/environment  

Why these difference among the two type of ?

Thanks in advance.

1 Answer 1

2

/etc/environment isn't used by Bash but by read by pam-env at login time.

That's why /etc/environment doesn't allow any shell syntax but only simple

NAME=value

lines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .