Where Is the Bash Config File?
.bashrc location in home plus .bash_profile, history and logout files on Linux.
Last updated
Bash reads .bashrc for interactive non-login shells, which covers nearly every terminal you open. Login shells read .bash_profile first, which conventionally sources .bashrc so settings apply everywhere.
History, aliases and prompts each have their own file. Version-control the set and every machine feels like home within minutes.
Where Bash stores this, by platform
~/.bashrc
Main interactive config with aliases, functions, prompt and completions. Login shells use ~/.bash_profile, history accumulates in ~/.bash_history, cleanup goes in ~/.bash_logout. System defaults sit in /etc/bash.bashrc and /etc/profile. Reload edits with source ~/.bashrc.
Frequently asked questions
Bash ignores my .bashrc changes. Why?
The shell running them is a login shell reading only .bash_profile. Source .bashrc from there, or reload the current shell explicitly.
Where is Bash command history?
In ~/.bash_history, written on shell exit. Commands from crashed shells never land there, which explains some missing entries.
Notice an outdated path? Let us know.