Download Linux course modules pdf

Transcript
Module 25
Tune the User Environment and System
Environment Variables
25.1
Configuration Files
■ Many programs, including shells, read configuration files
■ Files which apply to only one user are stored in that user’s home directory, usually as hidden
files
● Use ls -A in your home directory to find them
● Hidden files have names which start with ‘.’
● Often such files have names ending in rc, for ‘run commands’, for example the Vim editor
uses .vimrc
■ Sometimes whole directories of configuration information are present in a home directory, for
example .kde and .gnome
25.2
Shell Configuration Files
■ Bash reads ˜/.bashrc whenever it starts as an interactive shell
● That file often sources a global file, for example:
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
■ Bash also reads a profile file if it is a login shell
● First it reads the global configuration from /etc/profile
● Then one of ˜/.bash_profile, ˜/.bash_login or ˜/.profile
■ Login shells also source ˜/.bash_logout when the user exits
117