0303-0305.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 410 行
HTML
410 行
<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="0299-0302.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0306-0308.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-303"><P>Page 303</P></A>
<P>In addition to the files discussed, many other configuration files are found in the
/etc directory. The process of modifying and maintaining configuration files is covered in Chapter
15, "Essential System Administration,"
and Chapter 16, "Advanced System Administration."
</P>
<H5><A NAME="ch14_ 6">
/home
</A></H5>
<P>The /home directory is where all the home directories for all the users on a system are
stored. This includes home directories for actual users (people) and for users such as HTTPD.
An interesting feature of Linux is that the home directory for the user root is usually stored as <BR>
/home/root. This is different from many UNIX systems, where
/ is the home directory for the user root.
</P>
<H5><A NAME="ch14_ 7">
/mnt
</A></H5>
<P>By convention, the /mnt directory is the directory under which removable media such as <BR>
CD-ROMs, floppy disks, Zip disks, or Jaz disks are mounted. Usually the
/mnt directory contains a number of subdirectories, each of which is a mount point for a particular device
type. On my system, the /mnt directory looks like the following:
</P>
<!-- CODE SNIP //-->
<PRE>
cdrom/ floppy/ zip/
</PRE>
<!-- END CODE SNIP //-->
<P>By using subdirectories under /mnt to house all the mounted removable media, you keep the
/ directory clean.
</P>
<H4><A NAME="ch14_ 8">
/tmp and /var
</A></H4>
<P>The /tmp and /var directories are used to hold temporary files or files with constantly
varying content.
</P>
<P>The /tmp directory is usually a dumping ground for files that only need to be used briefly
and can afford to be deleted at any time. It usually is quite unstructured, but on a multiuser
system, most users abide by the convention of creating a personal directory (named the same as
their username) in /tmp for storing their temporary files. The most common use of
/tmp (other than as a location for throwaway files) is as a starting point for building and installing programs.
</P>
<P>The /var directory is a bit more structured than
/tmp and usually looks something like the following:
</P>
<!-- CODE SNIP //-->
<PRE>
catman/ local/ log/ nis/ run/ tmp/
lib/ lock/ named/ preserve/ spool/ yp/
</PRE>
<!-- END CODE SNIP //-->
<P>Of these directories, the /var/log directory is one of the directories with which all users
should be familiar, as most of the messages generated by the system are stored in it. On my system, <BR>
/var/log contains the following files:
</P>
<!-- CODE SNIP //-->
<PRE>
./ dmesg maillog savacct spooler wtmp
../ httpd/ messages secure usracct
cron lastlog pacct sendmail.st uucp/
</PRE>
<!-- END CODE SNIP //-->
<A NAME="PAGENUM-304"><P>Page 304</P></A>
<P>Of these files, the following are very helpful when attempting to diagnose system problems:
</P>
<UL>
<LI> dmesg contains the messages displayed when the system was last booted.
<LI>messages contains all the messages displayed at boot time since the system was
first booted.
</UL>
<H5><A NAME="ch14_ 9">
/usr
</A></H5>
<P>By convention, the /usr directory is where most programs and files directly relating to users
of the system are stored. It is in some ways a miniversion of the
/ directory. On my system, the /usr directory looks like the following:
</P>
<!-- CODE //-->
<PRE>
X11/ etc/ libexec/ share/
X11R6/ games/ local/ src/
X386@ i486-linuxaout/ man/ tmp@
bin/ include/ openwin/
dict/ info/ opt/
doc/ lib/ sbin/
</PRE>
<!-- END CODE //-->
<P>The contents of the various directories are briefly described in the following paragraphs.
</P>
<P>The /usr/bin and /usr/sbin directories hold the vast majority of the executables available
on a system. The function and type of the executables placed into these directories follow the
same general convention as for /bin and /sbin.
</P>
<P>The /usr/opt directory under Linux is equivalent to the
/opt directory in Solaris. It is the location where optional software packages are usually installed. For example, the Caldera
Internet-Office Suite is usually installed into/usr/opt.
</P>
<P>The /usr/X11 and /usr/X11R6 directories and subdirectories contain all of the X Window_
related files, such as man pages, libraries, and executables. Most Red Hat Linux systems
contain only /usr/X11R6, the 6 revision of the X Window version 11, but some older systems
might contain /usr/X11R5 or even /usr/X11R4, the 5 and 4 revisions of X Window version 11.
</P>
<P>Although X is the primary windowing environment under Linux, most installations will
also contain the /usr/openwin directory for storing files that use open windows. This includes
programs like olwm, textedit, and workman.
</P>
<P>The /usr/local directory is the location where local programs, man pages, and libraries
are installed. At many sites, most of the directories in
/usr are kept the same on every computer, but anything that needs to be installed on a particular machine is placed in
/usr/local, thus identifying those files as local files. This makes maintenance of large numbers of systems easier.
</P>
<P>Finally, one of the most useful directories under
/usr is /usr/dict. This is where the local dictionary, called
/usr/dict/words, for the system is stored. Most versions of
/usr/dict/words contain about 25,000 words, but some can be as large as a hundred thousand
or more.
</P>
<A NAME="PAGENUM-305"><P>Page 305</P></A>
<H3><A NAME="ch14_ 10">
RPM
</A></H3>
<P>One of the most powerful and innovative utilities available in Red Hat Linux is RPM, the
Red Hat Package Manager. It can be used to install, uninstall, upgrade, query, verify, and
build software packages.
</P>
<P>A software package built with RPM is an archive of files and some associated information,
such as a name, a version, and a description. A few of the advantages of RPM packages over
the traditional tar.gz method of software distribution are as follows:
</P>
<UL>
<LI> Upgrading—A new version of the software can be installed without
losing customization files.
<LI> Uninstalling—A software package that installs files in several locations can be
cleanly removed.
<LI> Verification—Once installed, a package can be verified to be in working order.
<LI> Querying—Information about what package a file belongs to can be easily obtained.
</UL>
<P>In addition to these features, RPM is available for many flavors of Linux and UNIX, making
it one of the emerging utilities for distributing
software packages.
</P>
<H4><A NAME="ch14_ 11">
Major Modes and Common Options
</A></H4>
<P>The major modes in which RPM can be run are the following:
</P>
<UL>
<LI> Install
(rpm -i)
<LI> Uninstall
(rpm -e)
<LI> Query
(rpm -q)
<LI> Verify
(rpm -V)
</UL>
<P>The options to invoke the major modes are given in parentheses. These major modes are
covered in detail in subsequent sections.
</P>
<P>All of these major modes understand the following options:
</P>
<TABLE WIDTH="360">
<TR><TD>
-vv
</TD><TD>
Prints out all debugging information; useful to see
what exactly RPM is doing
</TD></TR>
<TR><TD>
--quiet
</TD><TD>
Prints out very little information, only error messages
</TD></TR>
</TABLE>
<P>In addition to these, there are a few other "minor" modes that are useful. These are as follows:
</P>
<UL>
<LI> Version
(rpm --version)
<LI> Help (rpm
--help)
<LI> Showrc
(rpm --showrc)
<LI> Rebuilddb
(rpm --rebuilddb)
</UL>
<P><CENTER>
<a href="0299-0302.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0306-0308.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?