1

What command can I use to find out which file lists environment variables, as a user? It is not in ~/.bash_profile or ~/.bashrc.

Thanks

postoronnim
  • 467
  • 2
  • 10
  • 19
  • for ubuntu based distros you can check also /etc/environment – CGeorgian Nov 06 '16 at 20:48
  • Environoment variables can be set anywhere. Can you tell us which variable specifically you are searching for? – Emily Shepherd Nov 06 '16 at 20:50
  • http://stackoverflow.com/questions/532155/linux-where-are-environment-variables-stored - but to view use `printenv | less` – njha Nov 06 '16 at 20:51
  • There is no such thing as a file that "lists environment variables". Please ask what you are looking for. Not, how you think that you might be able to find what you are looking for. – arkascha Nov 06 '16 at 20:53

1 Answers1

1

Most of these things are going to be dynamic. You can get a look at the current environment by doing:

env | less

You can add environment variables into your session on bash startup by modifying ~/.bashrc and placing variables at the end of the file.

export PATH=$PATH:/home/user/custom_path
export CUSTOM_ENV_VARIABLE=somevalue
Zach
  • 509
  • 2
  • 3