Using Initialization Files Correctly
Problem
You’d like to know just what the heck is with all the initialization, or rc, files.
Solution
Here’s the cheat sheet for files and what do with them. Some or all of these files may be missing from your system, depending on how it is set up. Systems that use bash by default (e.g., Linux) tend to have a complete set; systems that use some other shell by default are usually missing at least some of them.
- /etc/profile
Global login environment file for Bourne and similar login shells. We recommend you leave this alone unless you are the system administrator and know what you are doing.
- /etc/bashrc (Red Hat) /etc/bash.bashrc (Debian)
Global environment file for interactive bash subshells. We recommend you leave this alone unless you are the system administrator and know what you are doing.
- /etc/bash_completion
If this exists, it’s almost certainly the configuration file for Ian Macdonald’s programmable completion library (see Improving Programmable Completion). We recommend looking into it—it’s pretty cool.
- /etc/inputrc
Global GNU Readline configuration. We recommend tweaking this as desired for the entire system (if you are the administrator), or tweaking ~/.inputrc for just you (Getting Started with a Custom Configuration). This is not executed or sourced but read in via Readline and
$INPUTRC, and$include(orbind -f). Note that it may containincludestatements to other Readline files.- ~/.bashrc
Personal environment file for interactive bash subshells. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access