Cover by Cameron Newham, JP Vossen, Carl Albing

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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, "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, "Getting Started with a Custom Configuration"). This is not executed or sourced but read in via Readline and $INPUTRC, and $include (or bind -f). Note that it may contain include statements to other ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required