⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0299-0302.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:


<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:Getting Started with Red Hat Linux</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311739 //-->

<!-- TITLE=RED HAT LINUX 2ND EDITION //-->

<!-- AUTHOR=DAVID PITTS ET AL //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS PUBLISHING //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=14 //-->

<!-- PAGES=0299-0318 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="../ch13/0295-0298.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0303-0305.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-299"><P>Page 299</P></A>











<H3><A NAME="ch14_ 1">

CHAPTER 14

</A></H3>









<H2>



Getting Started with<BR>

Red Hat Linux



</H2>



<B>by Sriranga R. Veeraraghavan</B>







<H3><A NAME="ch14_ 2">

IN THIS CHAPTER

</A></H3>









<UL>

<LI>     Organization

<LI>     RPM

</UL>







<A NAME="PAGENUM-300"><P>Page 300</P></A>





<P>This chapter covers the basics of getting started on a Red Hat Linux installation and takes

a look at the organization of the file on a system along with the installation of packaged

software using Red Hat Package Manager.

</P>









<H3><A NAME="ch14_ 3">

Organization

</A></H3>









<P>A Red Hat Linux installation is usually very nicely organized and fully featured, in

comparison with other UNIX and Linux distributions. This is because Red Hat complies with the

Linux filesystem standard (FSSTND). A complete description of the standard is available at

<a href="http://www.pathname.com/fhs/.">http://www.pathname.com/fhs/.</A>

</P>









<P>A feature of FSSTND is that the root directory,

/, is very clean and only holds the most essential files. My

/ looks something like the following:

</P>





<!-- CODE SNIP //-->

<PRE>

bin/         etc/         lost+found/  sbin/        var/

boot/        home/        mnt/         tmp/

dev/         lib/         proc/        usr/

</PRE>

<!-- END CODE SNIP //-->











<P>The following sections cover the types of files contained in most of these directories. The

/dev, /proc, and /boot directories and their contents are covered

in Chapter 11, &quot;Filesystems, Disks, and Other Devices.&quot;

</P>









<H4><A NAME="ch14_ 4">





/bin and /sbin

</A></H4>









<P>Most of the essential programs for using and maintaining a UNIX or Linux system are

stored in the /bin and /sbin directories. The bin in the names of these directories comes from the

fact that executable programs are binary files.

</P>









<P>The /bin directory is usually used to hold the most commonly used essential user

programs, such as

</P>









<UL>

<LI>     login



<LI>     Shells

(bash, ksh, csh)



<LI>     File manipulation utilities

(cp, mv, rm, ln, tar)



<LI>     Editors

(ed, vi)



<LI>     Filesystem utilities

(dd, df, mount, umount, sync)



<LI>     System utilities

(uname, hostname, arch)

</UL>









<P>In addition to these types of programs, the

/bin directory might also contain GNU utilities like

gzip and gunzip.

</P>









<P>The /sbin directory is used to hold essential maintenance or system programs such as the

following:

</P>









<UL>

<LI>     fsck



<LI>     fdisk

</UL>



<A NAME="PAGENUM-301"><P>Page 301</P></A>











<UL>

<LI>     mkfs



<LI>     shutdown



<LI>     lilo



<LI>     init

</UL>









<P>The main difference between the programs stored in

/bin and /sbin is that the programs in /sbin are executable only by root.

</P>









<H5><A NAME="ch14_ 5">

/etc

</A></H5>









<P>The /etc directory is normally used to store the systemwide configuration files required

by many programs. Some of the important files in

/etc are as follows:

</P>









<UL>



<LI>     passwd



<LI>     shadow



<LI>     fstab



<LI>     hosts



<LI>     motd



<LI>     profile



<LI>     shells



<LI>     services



<LI>     lilo.conf

</UL>









<P>The first two files in this list, /etc/passwd and

/etc/shadow, are files that define the authorized users for a system. The /etc/passwd

file contains all of the information about a user except

for the encrypted password, which is contained in /etc/shadow. This is done for security reasons. Manually editing these files is not recommended. To add or change user information,

follow the procedures covered in Chapter 19, &quot;User Accounts and Logins.&quot;

</P>









<P>The next file on the list, /etc/fstab, contains a list of devices that the system knows how

to mount automatically. A line from this file looks something like the following:

</P>





<!-- CODE SNIP //-->

<PRE>

/dev/hda1       /               ext2     defaults 1 1

</PRE>

<!-- END CODE SNIP //-->











<P>The first part, /dev/hda1, indicates the device to mount (in this case

the first partition of the internal hard drive,

hda). The second part, /, indicates where to mount the device. The

entry, ext2, indicates what type of filesystem the device contains, while the rest of the entries are

mount options (the default options are specified for this device).

</P>









<P>This file will contain at least two other entries, one for

swap and another for /proc. On many systems,/etc/fstab also contains entries for CD-ROMs, floppy disks, Zip disks, and

other mountable media.

</P>



<A NAME="PAGENUM-302"><P>Page 302</P></A>













<P>To add, delete, or change mount information, use Red Hat's

fstool, covered in Chapter 11.

</P>









<P>The file /etc/hosts contains a list of IP addresses and the corresponding hostnames (and

aliases). This list is used to resolve the IP address of a machine when its name is given. A sample

entry might look like the following:

</P>





<!-- CODE SNIP //-->

<PRE>

10.8.11.2       kanchi

</PRE>

<!-- END CODE SNIP //-->











<P>/etc/motd is the file in which the system administrator puts the message of the day (hence

the name motd). Usually, it contains information related to the system such as scheduled

downtime or upgrades of software, but it can contain anything. The contents of this file are

usually displayed at login.

</P>









<P>/etc/profile is the default initialization file for users whose shell is either

sh, ksh, or bash. Mostly it is used for settings variables like

PATH and PS1, along with things like the default

umask. It is not meant to be used in place of personal initialization files and should be kept small

because it is used by scripts as well as users.

</P>









<P>The file /etc/shells also pertains to shells. It is a list of &quot;approved&quot; shells for users. One of

its primary uses is to prevent people from accidentally changing their shells to

something unusable.

</P>









<P>In /etc/services is a list of all of the services that run on the various ports on the system.

The entries will look something like the following:

</P>





<!-- CODE SNIP //-->

<PRE>

telnet          23/tcp

http            80/tcp

</PRE>

<!-- END CODE SNIP //-->













<P>The first entry is the name of the service, the second entry is the port on which the service

runs, and the final entry is the type of service. From the preceding lines you can see that Telnet

runs on port 23 and HTTP runs on port 80, which are the standard ports for those services.

</P>









<P>The last file on the list is /etc/lilo.conf. This file contains a description of the behavior of

the system at boot time, along with listing all the bootable images on the system.

</P>









<P>There are also two important subdirectories in

/etc:

</P>









<UL>

<LI>     X11



<LI>     rc.d

</UL>









<P>The X11 subdirectory of /etc contains the configuration files for the X server and the

various window managers like fvwm, mwm, and twm. Most window manager packages will add their

configuration files into a directory located under

/etc/X11. An exception to this is a Red Hat Linux installation with the CDE (Common Desktop Environment) installed. The CDE is

covered in Chapter 6, &quot;Common Desktop Environment.&quot;

</P>









<P>The rc.d subdirectory of /etc contains initialization scripts that run when Linux is loaded

or shut down. Some of the scripts contain commands to load modules, while others handle

general boot behavior.

</P>



<P><CENTER>

<a href="../ch13/0295-0298.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0303-0305.html">Next</A>

</CENTER></P>









</td>
</tr>
</table>

<!-- begin footer information -->





</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -