Optional: Load modular configs from ~/.bashrc.d/
if [ -d ~/.bashrc.d ]; then for rc in ~/.bashrc.d/*; do if [ -f "$rc" ]; then . "$rc" fi done fi
unset rc
Explanation of Key Sections
- Global Definitions: sources
/etc/bashrcfor system-wide defaults. - PATH Setup: ensures
~/.local/binand~/binare included in$PATH. - Modular Configuration Support: if
~/.bashrc.d/exists, loads all scripts in it. Useful for organizing aliases, environment variables, and tool configs.
After Editing
Apply changes with:
source ~/.bashrc
Optional: Modular Setup
Create and use ~/.bashrc.d/ for custom scripts:
mkdir -p ~/.bashrc.d
echo "alias ll='ls -alF'" > ~/.bashrc.d/aliases.sh
Confirm OS (for context)
Check your OS version:
cat /etc/os-release
Example output:
Red Hat Enterprise Linux 8.10 (Ootpa)
Status
If you see no errors when running:
echo $PATH
your .bashrc is working as expected.