1

I using Redhat/Centos 6.5.

I am starting up the system and it already has environment variables set and is already running processes when it starts up.

My questions:

  • Where do these environment variables get set?
  • Where do these processes get set and how do I know what is running?
peterh
  • 9,488
  • 16
  • 59
  • 88
user4434
  • 37
  • 4
  • I think the first part of your question is answered here: [How to determine where an environment variable came from](https://unix.stackexchange.com/q/813/173368). – Haxiel Jan 14 '19 at 07:07

1 Answers1

1

Well, when you login in a RedHat based distro, you will land in your home directory which by default is in /home/user. In that directory you will find some hidden files/scripts that are executed in order to prepare your environment and other stuff.

Answer to question 1: .bashrc and .bash_profile are the files that load all the variables you see when you run the printenv or env command. You can see those files by running ls -la in your home directory.

Answer to question 2: The ps command by itselt won't show all the process that are running, you should run ps -ef instead. Of course you can filter that output using grep command like ps -ef|grep -i somethingtomatch or run the top command.

Run man ps and man top for more info about these utilities.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227