Startup Scripts


Startup scripts are not quite a part of the information stored in the users’ database in Linux. But they nonetheless play an important role in determining and controlling a user’s environment. In particular, the startup scripts in Linux are usually stored under the user’s home directory… and hence the need to mention them while still on the subject of the directory (home directory) field in the /etc/passwd file. Linux/UNIX was built from the get-go as a multiuser environment. Each user is allowed to have his or her own configuration files; thus, the system appears to be customized for each particular user (even if other people are logged in at the same time). The customization of each individual user environment is done through the use of shell scripts, run control files, and the like. These files can contain a series of commands to be executed by the shell that starts when a user logs in. In the case of the bash shell, for example, one of its startup files is the .bashrc file. (Yes, there is a period in front of the filename—filenames preceded by periods, also called dot files, are hidden from normal directory listings.) You can think of shell scripts in the same light as batch files, except shell scripts can be much more capable. The .bashrc script in particular is similar in nature to autoexec.bat in the Windows world. Various Linux software packages use application-specific and customizable options in directories or files that begin with a dot (.) in each user’s home directory. Some examples are .mozilla and .kde. Here are some common dot (.) files that are present in each user’s home directory:

• .bashrc/.profile Configuration files for BASH.

• .tcshrc/.login Configuration files for tcsh.

• .xinitrc This script overrides the default script that gets called when you log into the X Window System.

• .Xdefaults This file contains defaults that you can specify for X Window System applications.

When you create a user’s account, a set of default dot files are also created for the user; this is mostly for convenience, to help get the user started. The user creation tools discussed later on help you do this automatically. The default files are stored under the /etc/skel directory.

Source of Information : McGraw Hill Osborne Media Linux Administration A Beginners Guide Fifth Edition


Subscribe to Computing Tech

Enter your email address:

Delivered by FeedBurner

Add to Technorati Favorites Top Blogs