1

.bashrc could be reloaded by executing command source .bashrc after do some modifications.

Under this situation, command source .bashrc, the instructions in bashrc running in under the gnome-terminal

$ pstree -asp $$
systemd,1 splash
  └─systemd,2626 --user
      └─gnome-terminal-,5398
          └─bash,5507
              └─pstree,5690 -asp 5507

How about the bashrc in the boot process?

is it running under a terminal?

Wizard
  • 2,891

1 Answers1

4

The .bashrc file is not executed and will not show up as a process. Since it is a file, you can use tools to detect reads and writes.

When your shell (e.g. bash) starts up, it 'sources' files. This means that it opens and reads the file, and runs any commands in the file. The shell process itself does this, and as you're likely aware, this allows you to set up different environment variables, aliases, functions, etc.

There are other, similar files. .profile, .bash_profile and .bashrc all having slight technical differences, but similar functionality. You can see this great explanation and example of .bash_profile vs .bashrc. There are usually user-specific files in each user's home directory, and system configs in /etc/, such as /etc/bash.bashrc.

So, .bashrc is never executed, but instead sourced each time you start a new shell terminal spawns, or whenever you manually source the file: source ~/.bashrc.

terdon
  • 100,812
earthmeLon
  • 11,247