Reloading Shell Configs (source & .bashrc)
Concept & Overview
When you edit your startup scripts like ~/.bashrc to add new environment variables or aliases, those changes do not automatically affect your current shell session. Traditionally, users had to log out and log back in. In Linux, we use the source command (or its POSIX shorthand .) to read and execute commands from a file directly in the current shell context.
- Syntax: source ~/.bashrc or . ~/.bashrc
- This loads newly defined variables, updated $PATH directories, and aliases immediately without killing your session.
source ~/.bashrc (or . ~/.bashrc).Command Syntax Reference
| Command / Syntax | Description |
|---|---|
source ~/.bashrc | Execute commands from .bashrc in current shell |
. ~/.bashrc | POSIX dot alias for source command |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run source ~/.bashrc or . ~/.bashrc
Ready to complete Quest 119?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.