📄 0219-0221.html
字号:
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:Filesystems, Disks, and Other Devices</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=11 //-->
<!-- PAGES=0195-0228 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0216-0218.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0222-0224.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-219"><P>Page 219</P></A>
<TABLE WIDTH="360">
<TR><TD>
tar
</TD><TD>
This is widely used for creating archives in regular files but
was originally created for making tape backups. In fact,
tar stands for tape archiver. Archives made by tar can be read on a wide variety
of systems.
</TD></TR>
<TR><TD>
cpio
</TD><TD>
Another program principally intended for backups and so on,
cpio stands for copy in_out. The GNU version of
cpio, which is used by Linux distributions, supports eight different data formats—some
of which are varieties of its "native" format, two are varieties of
tar archives, and some are obsolete. If you want to unpack an
unknown archive, cpio, along with file and dd, is very useful.
</TD></TR>
<TR><TD>
dump
</TD><TD>
The dump utility is of use only to system administrators because
it backs up an ext2 filesystem by raw access to the block device
on which the filesystem exists. (For this reason, it is better to do
this when the filesystem is either not mounted or is mounted
read-only.) This has the advantage, among other things, that the access times
of the backed-up directories are left unmodified. (GNU
tar will also do this.) Although tapes written with
dump are not always readable on other versions of UNIX, unlike those written by
tar and cpio, this is a popular choice.
</TD></TR>
<TR><TD>
dd
</TD><TD>
Designed for blockwise I/O, dd is a general-purpose tool for
doing file manipulations and can often be very useful.
</TD></TR>
<TR><TD>
afio
</TD><TD>
A variant of cpio that compresses individual files
into the backup. For backups, this is preferable to
tar's compression of the whole archive because a small tape error can make a compressed
tar archive useless, although a tar archive that isn't compressed
doesn't have this vulnerability. This isn't very widely used outside the
Linux world.
</TD></TR>
<TR><TD>
Amanda
</TD><TD>
Amanda is a powerful backup system that schedules, organizes,
and carries out backups for you. It uses either
tar or dump to do the actual work, and will effortlessly allow you to automate all
the backups for one machine or a multitude. One of its most
useful features is its capability to do fast backups across the network
from several client machines to a single server machine containing a
tape drive. More information about Amanda is available at the
URL <a href="http://www.cs.umd.edu/projects/amanda/;">http://www.cs.umd.edu/projects/amanda/;</A> RPMs of Amanda
are available on the Red Hat FTP site.
</TD></TR>
<TR><TD>
BRU
</TD><TD>
BRU (Backup and Restore Utility) is a commercial product
for making backups.
</TD></TR>
</TABLE>
<A NAME="PAGENUM-220"><P>Page 220</P></A>
<H4><A NAME="ch11_ 23">
Terminals
</A></H4>
<P>The terminal is the principal mode of communication between the kernel and the user.
When you type keystrokes, the terminal driver turns them into input readable by the shell, or
whatever program you are running.
</P>
<P>For many years, UNIX ran only on serial terminals. While most computers now also have
video hardware, the terminal is still a useful concept. Each window in which you can run a shell
provides a separate pseudo-terminal, each one rather like a traditional serial terminal.
Terminals are often called ttys because the device nodes for many of them have names like
/dev/tty*.
</P>
<P>The terminal interface is used to represent serial lines to "real" terminals, to other
computers (via modems), mice, printers, and so on. The large variety of hardware addressed by the
terminal interface has led to a wide range of capabilities being offered by the terminal device
driver, and hence explaining all the facilities offered could easily occupy an entire chapter. This
section just offers an overview of the facilities.
</P>
<P>For more complete information on terminals and serial I/O, refer to the Linux
Documentation Project's excellent HOWTO documents. These are provided on the Red Hat Linux
4.2 CD-ROM and are also available on the Web at
<a href="http://sunsite.unc.edu/ldp/.">http://sunsite.unc.edu/LDP/.</A> Specific HOWTOs dealing with this are the Serial-HOWTO, section 9 of the
Hardware-HOWTO, and the Serial Port Programming mini-HOWTO. There are many documents dealing
with using modems for networking. These are mentioned later in the chapter in
the section "Using Modems."
</P>
<H4><A NAME="ch11_ 24">
The Terminal Device Driver
</A></H4>
<P>The terminal device driver gathers the characters that you type at the keyboard and sends
them on to the program you're working with, after some processing. This processing can
involve gathering the characters into batches a line at a time and taking into account the special
meanings of some keys you might type.
</P>
<P>Some special keys of this sort are used for editing the text that is sent to the program
you're interacting with. Much of the time, the terminal driver is building a line of input that it
hasn't yet sent to the program receiving your input. Keys that the driver will process specially
include the following:
</P>
<TABLE WIDTH">
<TR><TD>
Return (CR) or Line feed (LF)
</TD><TD>
CR is usually translated into LF by
the terminal driver (see the icrnl option in the manual page for
stty). This ends the current line, which is then sent to the application (it
is waiting for terminal input, so it wakes up).
</TD></TR>
</TABLE>
<A NAME="PAGENUM-221"><P>Page 221</P></A>
<TABLE WIDTH"360>
<TR><TD>
Backspace/Delete
</TD><TD>
Only one of these two keys can be selected
as the erase key, which erases the previous character typed. For more information,
read the Linux Keyboard Setup mini-HOWTO.
</TD></TR>
<TR><TD>
End-of-File, usually Ctrl+D
</TD><TD>
When a program is reading its standard
input from the keyboard, and you want to let it know that you've typed everything that
you're going to, you press Ctrl+D.
</TD></TR>
<TR><TD>
Word-erase, usually Ctrl+W
</TD><TD>
Deletes the last word you typed.
</TD></TR>
<TR><TD>
Kill-Line, usually Ctrl+U
</TD><TD>
This kills the entire line of input so that
you can start again.
</TD></TR>
<TR><TD>
Interrupt, usually Ctrl+C
</TD><TD>
Kills the current program. Some
programs block this at times when the program
might leave the terminal in a strange state if it
were unexpectedly killed.
</TD></TR>
<TR><TD>
Suspend, usually Ctrl+Z
</TD><TD>
This key sends a suspend signal to
the program you're using. The result is that the program is stopped temporarily, and you
get the shell prompt again. You can then put that program (job) in the background and
do something else. See Chapter 21, "Shell Programming," for more information.
</TD></TR>
<TR><TD>
Quit, usually Ctrl+\ (Ctrl+Backslash)
</TD><TD>
Sends a Quit signal to the current
program; programs that ignore Ctrl+C can often be stopped with Ctrl+\, but programs
ignoring Ctrl+C are often doing so for a reason.
</TD></TR>
<TR><TD>
Stop, usually Ctrl+S, and Start,
usually Ctrl+Q
</TD><TD>
These stop
and restart terminal output
temporarily, which can be useful if a com-
mand produces a lot of output, although it
can often be more useful just to repeat the
command and pipe it through less.
</TD></TR>
</TABLE>
<P>There are many other terminal modes and settings; these can be examined with
the stty command. This command has a built-in set of sensible settings for terminals, and normally
when you just type stty to find the current settings, it just shows you the differences from its
"sane" settings:
</P>
<!-- CODE SNIP //-->
<PRE>
$ stty
speed 9600 baud; line = 0;
</PRE>
<!-- END CODE SNIP //-->
<P><CENTER>
<a href="0216-0218.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0222-0224.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -