Linux Env and PATH
Environment variables, PATH order, and persistent shell config.
- linux PATH
- export env
- bashrc profile
- environment variable
- source config
Linux Env and PATH
Environment variables, PATH order, and persistent shell config.
Commands
| Command | What it does | |
|---|---|---|
| `printenv | sort` | All exported variables |
echo PATH tr colon | One directory per line | |
export PATH-priority | Prepend your bin dir | |
source bashrc | Reload shell config | |
env -i minimal run | Clean-room command test |
Example
export PATH="$HOME/.local/bin:$PATH"
echo "$PATH" | tr ':' '\n' | head
FAQ
Changes vanish after logout - why?
export in the shell lasts for that session only; persist in profile or bashrc files.
Which file loads when?
Login shells read profile, interactive non-login shells read bashrc - put PATH in both or source one from the other.
الأسئلة الشائعة
Changes vanish after logout - why?
export in the shell lasts for that session only; persist in profile or bashrc files.
Which file loads when?
Login shells read profile, interactive non-login shells read bashrc - put PATH in both or source one from the other.
Linux
Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
Linux Permissions
Read ls output, chmod, chown, and sudo without breaking access.
Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
Linux grep and find
Find files by name, age, and size; search inside them fast.