LINUX / A CONCEPT NOTE
Shell Startup Chain
.bashrc vs .profile
Overview · mechanism
pitfall · examples
01 / THE SHORT VERSION
The idea in a few sentences.
Linux shells read startup configuration files. Interactive login shells load /etc/profile then ~/.bash_profile, while non-login subshells load ~/.bashrc directly.
02 / FOLLOW THE MECHANISM
How startup initialization flows
Login Shell
SSH login starts, reading profile configurations to initialize shell environment.
Interactive subshell
user opens a new terminal window inside current session, skipping profile.
Rc Load
shell loads ~/.bashrc to configure custom shell variables, aliases, and terminal colors.
Ready Prompt
shell displays prompt, waiting for user instructions.
04 / COMMAND NOTES
Read the command, then the result.
Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.
reload bash configuration settings in the current session
source ~/.bashrcstart a new bash shell simulating interactive login credentials
bash --login05 / CHECK YOURSELF
Could you explain Shell Startup Chain to a teammate?
Try it out loud in two sentences: what it is, and the one detail that changes the picture. If you stall, the gap is the part to reread.