logo
Linux User
OpenSource Apache Embedded C Linux MySQL Perl PHP Samba

Module Release October 2003: Tuning the User and System Environment

This month's offering is a short module about managing the user and program environment provided on your system.

LPI Objective 1.111.2 (“Tune the user environment and system environment variables”) expects you to be able to:

“modify global and user profiles … includ[ing] setting environment variables, maintaining skel directories for new user accounts and setting command search path with the proper directory”

This module begins by explaining how programs pick up configuration information on a system-wide and per-user basis when they are executed, noting typical file names and directories used, e.g., ‘dot’ files ‘rc’ files or directories like .gnome and .kde.

The respective roles of shell configuration files like ~/.bashrc, /etc/bashrc, ~/.bash_profile, ~/.bash_login, ~/.profile, ~/etc/profile, and ~/.bash_logout are outlined.

Attention is then directed to ‘environment variables’, i.e., the settings and values which are made available to programs when they run in a particular shell or under specific conditions. The PATH environment variable, which tells the shell (command interpreter) where to look for executable programs on the file system, is used as an illustration of how environment variables are set and ‘exported’. A trivial example of how to reset the shell prompt is given.

Shell aliases are dealt with next. Shell aliasing allows you to provide an alternative name for a particular command and to ensure that it always runs with a specific set of options, e.g., some commercial distributions alias the remove command (rm) to always run with the --interactive option set, so that the novice user is prompted to confirm deletions.

Finally, the module explains the use of skeleton configuration files, stored in /etc/skel, how to create new users' home directories and how to populate them with a set of default configuration files.