O'Reilly logo

LPI Linux Certification in a Nutshell, 3rd Edition by James Stanger, Bruno Gomes Pessanha, Stephen Addison Schneiter, Adam Haeder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuration files

It’s a good assumption that every Linux user will want to define a few aliases, functions, and environment variables to suit his or her needs. However, it’s undesirable to manually enter them upon each login or for each new invocation of bash. To set up these things automatically, bash uses a number of configuration files to set its operating environment when it starts. Some of these files are used only upon initial login, whereas others are executed for each instance of bash you start, including at login time. Some of these configuration files are system-wide files for all users to use, whereas others reside in your home directory for your use alone.

bash configuration files important to Exam 102 are listed in Table 13-1.

Table 13-1. bash configuration files

File

Description

/etc/profile

This is the system-wide initialization file executed during login. It usually contains environment variables, including an initial PATH, and startup programs.

/etc/bashrc

This is another system-wide initialization file that may be executed by a user’s .bashrc for each bash shell launched. It usually contains functions and aliases.

~/.bash_profile

If this file exists, it is executed automatically after /etc/profile during login.

~/.bash_login

If .bash_profile doesn’t exist, this file is executed automatically during login.

~/.profile

If neither .bash_profile nor .bash_login exists, this file is executed automatically during login. Note that this is the original Bourne shell configuration file. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required