Finding Configuration Files

Finding Configuration Files

User -configurable Unix programs (including your shell, the vi editor, and others) look for configuration files in your home directory when they start up. Most of the commands you have learned so far are not user configurable; neither the ls nor the cd command uses configuration files, for example. They do accept options on the command line but do not read any configuration files when you run them.

Many configuration filenames begin with a dot (.), so they are called dot files (use ls -a to see them). Often the filenames end in "rc" (for resource ). For example, the main configuration file for the bash shell is ~/.bash_profile , a configuration file for the tcsh shell is ~/.tcshrc , and the configuration file for the vi editor is called ~/.exrc ( ex is an older editor, and vi provides a "visual interface" for it). There are actually several configuration files available for each shell, and Table 7.1 lists the more common ones. In this chapter, we will concentrate on the ones you would change in the course of normal use. These files each have settings and commands for the particular program being configured. (Remember that ~ [the tilde] is a synonym for your home directory.)

Table 7.1. A Summary of Common Shells

S HELL

N AME AND D ESCRIPTION

sh

Bourne shell . The oldest and most standardized shell. Widely used for system-startup files (scripts run during system startup). Installed in Mac OS X.

bash

bash (Bourne Again Shell). An improved version of sh . Combines features from csh , sh , and ksh . Very widely used, especially on Linux systems. See the Bash Reference Manual online (www.gnu.org/manual/bash/bash.html). The default shell in Mac OS X 10.3 and later.

csh

C shell . Provides scripting features that have a syntax similar to that of the C programming language (originally written by Bill Joy). Installed in Mac OS X.

ksh

Korn shell . Developed at AT&T by David Korn in the early 1980s. ksh is widely used for programming. It is now open -source software, although you must agree to AT&T's license to install it. See the KornShell Web site (www.kornshell.com).

tcsh

An improved version of csh . The t in tcsh comes from the TENEX and TOPS-20 operating systems, which provided a command-completion feature that the creator (Ken Greer) of tcsh included in his new shell. Wilfredo Sanchez, formerly lead engineer on Mac OS X for Apple, worked on tcsh in the early 1990s at the Massachusetts Institute of Technology. The default shell in Mac OS X 10.2 and earlier.

zsh

Z shell . Created in 1990, zsh combines features from tcsh , bash , and ksh , and adds many of its own. Installed in Mac OS X. The Web site for Z shell is http://zsh. sourceforge .net.


Configuration files for shells are actually scripts. This means they are a series of commands written in the scripting language for the corresponding shell. They make use of variables , if-then conditions, and other scripting elements, such as loops . (See Chapter 9, "Creating and Using Scripts," for more on scripts.)



Unix for Mac OS X 10. 4 Tiger. Visual QuickPro Guide
Unix for Mac OS X 10.4 Tiger: Visual QuickPro Guide (2nd Edition)
ISBN: 0321246683
EAN: 2147483647
Year: 2004
Pages: 161
Authors: Matisse Enzer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net