Linux

Where Is the .bashrc File on Linux?

The per user .bashrc on Linux, the system template it came from, and why login shells skip it.

Last updated

Interactive Bash shells read ~/.bashrc on startup, which is where aliases, prompts and PATH tweaks belong. New accounts receive a copy from /etc/skel, so your .bashrc started life as the system template with local edits on top.

Login shells skip it and read profile files instead, the classic reason a new alias works in terminals but not over SSH. Source .bashrc from ~/.bash_profile to cover both, or place shared setup where both paths load it. Apply edits with source ~/.bashrc in the running shell.

Where Linux stores this, by platform

Linux
~/.bashrc

Per user interactive shell setup. System defaults live in /etc/bash.bashrc and the /etc/skel template new accounts copy. Login shells read ~/.bash_profile instead, so bridge the two when settings seem to vanish.

Frequently asked questions

Why does my alias work in the terminal but not over SSH?

SSH starts a login shell, which reads ~/.bash_profile instead of ~/.bashrc. Source .bashrc from your profile file and the alias works in both.

Where do new users get their .bashrc from?

From /etc/skel/.bashrc, copied at account creation. Edit the skeleton to change defaults for future users; existing users keep their own copies untouched.

Notice an outdated path? Let us know.