Linux Know-How provides a collection of introductory texts on often needed Linux skills. |
Home Bash Guide for Beginners The Bash environment Configuration Individual user configuration files | |||||||||
See also: Home Directories and Users, System-wide configuration files | |||||||||
Search the VIAS Library | Index | |||||||||
Individual user configuration files
~/.bash_profileThis is the preferred configuration file for configuring user environments individually. In this file, users can add extra configuration options or change default settings:
This user configures the backspace character for login on different operating systems. Apart from that, the user's .bashrc and .bash_login are read. ~/.bash_loginThis file contains specific settings that are normally only executed when you log in to the system. In the example, we use it to configure the umask value and to show a list of connected users upon login. This user also gets the calendar for the current month:
In the absence of ~/.bash_profile, this file will be read. ~/.profileIn the absence of ~/.bash_profile and ~/.bash_login, ~/.profile is read. It can hold the same configurations, which are then also accessible by other shells. Mind that other shells might not understand the Bash syntax. ~/.bashrcToday, it is more common to use a non-login shell, for instance when logged in graphically using X terminal windows. Upon opening such a window, the user does not have to provide a user name or password; no authentication is done. Bash searches for ~/.bashrc when this happens, so it is referred to in the files read upon login as well, which means you don't have to enter the same settings in multiple files. In this user's .bashrc a couple of aliases are defined and variables for specific programs are set after the system-wide /etc/bashrc is read:
More examples can be found in the Bash package. Remember that sample files might need changes in order to work in your environment. Aliases are discussed in Section 3.5. ~/.bash_logoutThis file contains specific instructions for the logout procedure. In the example, the terminal window is cleared upon logout. This is useful for remote connections, which will leave a clean window after closing them.
|
|||||||||
Home Bash Guide for Beginners The Bash environment Configuration Individual user configuration files |