summary tables of new commands

This commit is contained in:
tille 2006-10-26 15:37:52 +00:00
parent b6cbd9d7c4
commit fcfab823e0
10 changed files with 340 additions and 66 deletions

View File

@ -139,7 +139,7 @@
<revnumber>1.24</revnumber>
<date>2006-11-01</date>
<authorinitials>MG</authorinitials>
<revremark>added index terms, prepared for second printed edition, added gpg info.</revremark>
<revremark>added index terms, prepared for second printed edition, added gpg and proxy info.</revremark>
</revision>
<revision>
<revnumber>1.23</revnumber>

View File

@ -310,6 +310,7 @@ traceroute to www.eunet.be(193.74.208.177),30 hops max,38b packets
22.714ms 19.193ms 18.432ms
9 dukat.Belgium.EU.net (193.74.208.178) 22.758ms * 25.263ms
</screen>
<para>On some systems, <command>traceroute</command> has been renamed to <command>tracepath</command>.</para>
</sect3>
<sect3 id="sect_10_02_06_04"><title>The whois command</title>
<para>Specific domain name information can be queried using the <command>whois<indexterm><primary>whois</primary></indexterm></command> command, as is explained by many <command>whois</command> servers, like the one<indexterm><primary>networking</primary><secondary>info on hosts</secondary></indexterm> below:</para>
@ -950,7 +951,70 @@ tcp 0 0 ::1:x11-ssh-offset *:* LISTEN
<para>Linux is well known as a stable platform for running various Internet services, the amount of Internet software is endless. Like UNIX, Linux can be just as well used and administered from a remote location, using one of several solutions for remote execution of programs.</para>
<para>We briefly touched the subject of security. Linux is an ideal firewall system, light and cheap, but can be used in several other network functions such as routers and proxy servers.</para>
<para>Increasing network security is mainly done by applying frequent updates and common sense.</para>
<para>Here is an overview of network related commands:</para>
<table frame="all">
<title>New commands in chapter 10: Networking</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Command</entry><entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><command>ftp</command></entry><entry>Transfer files to another host (insecure).</entry>
</row>
<row>
<entry><command>host</command></entry><entry>Get information about networked hosts.</entry>
</row>
<row>
<entry><command>ifconfig</command></entry><entry>Display IP address information.</entry>
</row>
<row>
<entry><command>ip</command></entry><entry>Display IP address information.</entry>
</row>
<row>
<entry><command>netstat</command></entry><entry>Display routing information and network statistics.</entry>
</row>
<row>
<entry><command>ping</command></entry><entry>Send answer requests to other hosts.</entry>
</row>
<row>
<entry><command>rdesktop</command></entry><entry>Display and MS Windows desktop on your Linux system.</entry>
</row>
<row>
<entry><command>route</command></entry><entry>Show routing information.</entry>
</row>
<row>
<entry><command>scp</command></entry><entry>Secure copy files to and from other hosts.</entry>
</row>
<row>
<entry><command>sftp</command></entry><entry>Secure FTP files to and from other hosts.</entry>
</row>
<row>
<entry><command>ssh</command></entry><entry>Make an encrypted connection to another host.</entry>
</row>
<row>
<entry><command>ssh-keygen</command></entry><entry>Generate authentication keys for <application>Secure SHell</application>.</entry>
</row>
<row>
<entry><command>telnet</command></entry><entry>Make an insecure connection to another hosts.</entry>
</row>
<row>
<entry><command>tracepath/traceroute</command></entry><entry>Print the route that packets follow to another host.</entry>
</row>
<row>
<entry><command>whois</command></entry><entry>Get information abotu a domain name.</entry>
</row>
<row>
<entry><command>xclock</command></entry><entry>X Window clock application, handy for testing remote display.</entry>
</row>
<row>
<entry><command>xhost</command></entry><entry>X Window access control tool.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 id="sect_10_09"><title>Exercises</title>

View File

@ -13,7 +13,7 @@
</abstract>
<sect1 id="sect_11_01"><title>Audio Basics</title>
<sect2 id="sect_11_01_01"><title>Installation</title>
<para>Most likely, your system is already installed with audio drivers and the configuration was done at installation time. Likewise, should you ever need to replace your audio hardware, most systems provide tools that allow easy setup and configuration of the device. Most currently available
<para>Most likely, your system is already installed with audio<indexterm><primary>audio</primary><secondary>drivers</secondary></indexterm> drivers and the configuration was done at installation time. Likewise, should you ever need to replace your audio hardware, most systems provide tools that allow easy setup and configuration of the device. Most currently available
plug-and-play sound cards should be recognized automatically. If you can hear the samples that are played during configuration, just click <guibutton>OK</guibutton>
and everything will be set up for you.</para>
<para>If your card is not detected automatically, you may be presented with a list of sound cards and/or of sound card properties from which to choose. After that, you will have to provide the correct I/O port, IRQ and DMA settings. Information about these settings can be found in your sound card documentation. If you are on a dual boot system with MS Windows, this information can be found in the Windows Control Panel as well.</para>
@ -23,7 +23,7 @@ If your soundcard is not supported by default, you will need to apply other tech
</note>
</sect2>
<sect2 id="sect_11_01_02"><title>Drivers and Architecture</title>
<para>There are generally two types of sound architecture: the older Open Sound System or OSS, which works with every UNIX-like system, and the newer Advanced Linux Sound Architecture or ALSA, that has better support for Linux, as the name indicates. ALSA also has more features and allows for faster driver development. We will focus here on the ALSA system.</para>
<para>There are generally two types of sound architecture<indexterm><primary>audio</primary><secondary>architecture</secondary></indexterm>: the older Open Sound System or OSS<indexterm><primary>audio</primary><secondary>OSS</secondary></indexterm>, which works with every UNIX-like system, and the newer Advanced Linux Sound Architecture<indexterm><primary>audio</primary><secondary>ALSA</secondary></indexterm> or ALSA, that has better support for Linux, as the name indicates. ALSA also has more features and allows for faster driver development. We will focus here on the ALSA system.</para>
<para>Today, almost all mainstream audio chipsets are supported. Only some high-end professional solutions and some cards developed by manufacturers refusing to document their chipset specifications are unsupported. An overview of supported devices can be found on the ALSA site at <ulink url="http://www.alsa-project.org/alsa-doc/index.php?vendor=All#matrix" />.</para>
<para>Configuring systems installed with ALSA is done using the <command>alsaconf</command> tool. Additionally, distributions usually provide their own tools for configuring the sound card; these tools might even integrate the old and the new way of handling sound devices.</para>
@ -31,19 +31,19 @@ If your soundcard is not supported by default, you will need to apply other tech
</sect1>
<sect1 id="sect_11_02"><title>Sound and video playing</title>
<sect2 id="sect_11_02_01"><title>CD playing and copying</title>
<para>The <emphasis>cdp</emphasis> package comes with most distributions and provides <command>cdp</command> or <command>cdplay</command>, a text-based CD player. Desktop managers usually include a graphical tool, such as the <command>gnome-cd</command> player in Gnome, that can be started from a menu.</para>
<para>The <emphasis>cdp</emphasis> package<indexterm><primary>cdp</primary></indexterm> comes with most distributions and provides <command>cdp</command> or <command>cdplay<indexterm><primary>cdplay</primary></indexterm></command>, a text-based CD player<indexterm><primary>CD</primary><secondary>audio CD playing</secondary></indexterm>. Desktop managers usually include a graphical tool, such as the <command>gnome-cd<indexterm><primary>gnome-cd</primary></indexterm></command> player in <application>Gnome</application>, that can be started from a menu.</para>
<para>Be sure to understand the difference between an audio CD and a data CD.
You do not have to mount an audio CD into the file system in order to listen to it. This is because the data on such a CD are not Linux file system data; they are accessed and sent to the audio output channel directly, using a CD player program. If your CD is a data CD containing <filename>.mp3</filename> files, you will first need to mount it into the file system, and then use one of the programs that we discuss below in order to play the music. How to mount CDs into the file system is explained in <xref linkend="sect_07_06_05" />.</para>
<para>The <command>cdparanoia</command> tool from the package with the same name
reads audio directly as data from the CD, without analog conversions, and writes data to a file or pipe in different formats, of which <filename>.wav</filename> is probably the most popular. Various tools for conversion to other formats, formats,
<para>The <command>cdparanoia<indexterm><primary>cdparanoia</primary></indexterm></command> tool from the package with the same name
reads audio directly<indexterm><primary>CD</primary><secondary>audio CD ripping</secondary></indexterm> as data from the CD, without analog conversions, and writes data to a file or pipe in different formats, of which <filename>.wav</filename> is probably the most popular. Various tools for conversion to other formats, formats,
such as <filename>.mp3</filename>, come with most distributions or are downloadable as separate packages. The GNU project provides several CD playing, ripping and encoding tools, database managers; see the <ulink url="http://www.gnu.org/directory/audio/">Free Software Directory, Audio section</ulink> for detailed information.</para>
<para>Audio-CD creation is eased, among many others, with the <command>kaudiocreator</command> tool from the KDE suite. It comes with clear information from the KDE Help Center.</para>
<para>Audio-CD creation is eased, among many others, with the <command>kaudiocreator<indexterm><primary>kaudiocreator</primary></indexterm></command> tool from the KDE suite. It comes with clear information from the KDE Help Center.</para>
<para>CD burning is covered in general in <xref linkend="sect_09_02_02" />.</para>
</sect2>
<sect2 id="sect_11_02_02"><title>Playing music files</title>
<sect3 id="sect_11_02_02_01"><title>mp3 files</title>
<para>The popular <filename>.mp3</filename> format is widely supported on Linux
<para>The popular <filename>.mp3</filename> format<indexterm><primary>files</primary><secondary>music files</secondary></indexterm> is widely supported on Linux
machines. Most distributions include multiple programs that can play these files. Among many other applications, <application>XMMS</application>, which is presented in the screenshot below, is one of the most wide-spread, partially because it has the same look and feel as the Windows tool.</para>
<figure><title>XMMS mp3 player</title>
@ -63,7 +63,7 @@ You do not have to mount an audio CD into the file system in order to listen to
<note><title>Restrictions</title>
<para>Some distributions don't allow you to play MP3's without modifying your configuration, this is due to license restrictions on the MP3 tools. You might need to install extra software to be able to play your music.</para>
</note>
<para>In text mode, you can use the <command>mplayer</command> command:</para>
<para>In text mode, you can use the <command>mplayer<indexterm><primary>mplayer</primary></indexterm></command> command:</para>
<screen>
<prompt>[tille@octarine ~]$ </prompt><command>mplayer <filename>/opt/mp3/oriental/*.mp3</filename></command>
MPlayer 1.0pre7-RPM-3.4.2 (C) 2000-2005 MPlayer Team
@ -96,7 +96,7 @@ A: 227.8 (03:23:.1) 1.8% 12%
</screen>
</sect3>
<sect3 id="sect_11_02_02_02"><title>Other formats</title>
<para>It would lead us too far to discuss all possible audio formats and ways to play them. An (incomplete) overview of other common sound playing and manipulating software:</para>
<para>It would lead us too far to discuss all possible audio formats and ways to play them. An (incomplete) overview of other common sound<indexterm><primary>audio</primary><secondary>applications</secondary></indexterm> playing and manipulating software:</para>
<itemizedlist>
<listitem><para>Ogg Vorbis: Free audio format: see <ulink url="http://www.gnu.org/directory/audio/ogg/">the GNU audio directory</ulink> for tools - they might be included in your distribution as well. The format was developed because MP3 is patented.</para></listitem>
<listitem><para>Real audio and video: <command>realplay</command> from <ulink url="http://real.com">RealNetworks</ulink>.</para></listitem>
@ -119,13 +119,13 @@ see the <ulink url="http://www.alsaplayer.org">AlsaPlayer web site</ulink>.</par
</note>
</sect3>
<sect3 id="sect_11_02_02_03"><title>Volume control</title>
<para><command>aumix</command> and <command>alsamixer</command> are two common text tools for adjusting audio controls. Use the arrow keys to toggle settings. The <command>alsamixer</command> has a graphical interface when started from the Gnome menu or as <command>gnome-alsamixer</command> from the command line. The <command>kmix</command> tool does the same in KDE.</para>
<para><command>aumix<indexterm><primary>aumix</primary></indexterm></command> and <command>alsamixer<indexterm><primary>alsamixer</primary></indexterm></command> are two common text tools for adjusting audio<indexterm><primary>audio</primary><secondary>volume control</secondary></indexterm> controls. Use the arrow keys to toggle settings. The <command>alsamixer</command> has a graphical interface when started from the <application>Gnome</application> menu or as <command>gnome-alsamixer<indexterm><primary>gnome-alsamixer</primary></indexterm></command> from the command line. The <command>kmix<indexterm><primary>kmix</primary></indexterm></command> tool does the same in KDE.</para>
<para>Regardless of how you choose to listen to music or other sounds, remember that there may be other people who may not be interested in hearing you or your
computer. Try to be courteous, especially in office environments. Use a quality head-set, rather than the ones with the small ear pieces. This is better for your ears and causes less distraction for your colleagues.</para>
</sect3>
</sect2>
<sect2 id="sect_11_02_03"><title>Recording</title>
<para>Various tools are again available that allow you to record voice and music. For recording voice you can use <command>arecord</command> on the command line:</para>
<para>Various tools are again available that allow you to record voice and music. For recording voice you can use <command>arecord<indexterm><primary>arecord</primary></indexterm></command> on the command<indexterm><primary>audio</primary><secondary>recording</secondary></indexterm> line:</para>
<screen>
<prompt>alexey@russia:~&gt;</prompt> <command>arecord <filename>/var/tmp/myvoice.wav</filename></command>
Recording WAVE '/var/tmp/myvoice.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono
@ -133,11 +133,11 @@ Aborted by signal Interrups...
</screen>
<para><quote>Interrupt</quote> means that the application has caught a <keycap>Ctrl</keycap>+<keycap>C</keycap>. Play the sample using the simple <command>play</command> command.</para>
<para>This is a good test that you can execute prior to testing applications that need voice input, like Voice over IP (VoIP). Keep in mind that the microphone input should be activated. If you don't hear your own voice, check your sound settings. It often happens that the microphone is muted or on verry low volume. This can be easily adjusted using <command>alsamixer</command> or your distribution-specific graphical interface to the sound system.</para>
<para>In KDE you can start the <command>krec</command> utility, Gnome provides the <command>gnome-sound-recorder</command>.</para>
<para>In KDE you can start the <command>krec<indexterm><primary>krec</primary></indexterm></command> utility, <application>Gnome</application> provides the <command>gnome-sound-recorder<indexterm><primary>gnome-sound-recorder</primary></indexterm></command>.</para>
</sect2>
</sect1>
<sect1 id="sect_11_02_04"><title>Video playing, streams and television watching</title>
<para>Various players are available:</para>
<para>Various players<indexterm><primary>video</primary><secondary>applications</secondary></indexterm> are available:</para>
<itemizedlist>
<listitem><para><command>xine</command>: a free video player</para></listitem>
<listitem><para><command>ogle</command>: DVD player.</para></listitem>
@ -161,17 +161,17 @@ Aborted by signal Interrups...
</sect1>
<sect1 id="sect_11_02_05"><title>Internet Telephony</title>
<sect2 id="sect_11_02_05_01"><title>What is it?</title>
<para>Internet telephony, or more common, Voice over IP (VoIP) or digital telephony allows parties to exchange voice data flows over the network. The big difference is that the data flows over a general purpose network, the Internet, contrary to conventional telephony, that uses a dedicated network of voice transmission lines. The two networks can be connected, however, under special circumstances, but for now this is certainly not a standard. In other words: it is very likely that you will not be able to call people who are using a conventional telephone. If it is possible at all, it is likely that you will need to pay for a subscription.</para>
<para>Internet telephony<indexterm><primary>VoIP</primary><secondary>what?</secondary></indexterm>, or more common, Voice over IP (VoIP) or digital telephony allows parties to exchange voice data flows over the network. The big difference is that the data flows over a general purpose network, the Internet, contrary to conventional telephony, that uses a dedicated network of voice transmission lines. The two networks can be connected, however, under special circumstances, but for now this is certainly not a standard. In other words: it is very likely that you will not be able to call people who are using a conventional telephone. If it is possible at all, it is likely that you will need to pay for a subscription.</para>
<para>While there are currently various applications available for free download, both free and proprietary, there are some major drawbacks to telephony over the Internet. Most noticably, the system is unreliable, it can be slow or there can be a lot of noise on the connection, and it can thus certainly not be used to replace conventional telephony - think about emergency calls. While some providers take their precautions, there is no guarantee that you can reach the party that you want to call.</para>
<para>Most applications currently do not use encryption, so be aware that it is potentially easy for someone to eavesdrop on your conversations. If security is a concern for you, read the documentation that comes with your VoIP client. Additionally, if you are using a firewall, it should be configured to allow incoming connections from anywhere, so using VoIP also includes taking risks on the level of site security.</para>
</sect2>
<sect2 id="sect_11_05_02"><title>What do you need?</title>
<sect3 id="sect_11_05_02_01"><title>Server Side</title>
<para>First of all, you need a provider offering the service. This service might integrate traditional telephony and it might or might not be free. Among others are <ulink url="http://www.sipphone.com/">SIPphone</ulink>, <ulink url="http://www.vonage.com/">Vonage</ulink>, <ulink url="http://www.lingo.com/">Lingo</ulink>, <ulink url="http://www.totaltalk.com/">AOL TotalTalk</ulink> and many locally accessible providers offering the so-called <quote>full phone service</quote>. Internet phone service only is offered by <ulink url="http://www.skype.com/">Skype</ulink>, <ulink url="http://www.sipbroker.com/">SIP Broker</ulink>, <ulink url="http://www.google.com/talk/">Google</ulink> and many others.</para>
<para>First of all, you need a provider offering the service<indexterm><primary>VoIP</primary><secondary>service providers</secondary></indexterm>. This service might integrate traditional telephony and it might or might not be free. Among others are <ulink url="http://www.sipphone.com/">SIPphone</ulink>, <ulink url="http://www.vonage.com/">Vonage</ulink>, <ulink url="http://www.lingo.com/">Lingo</ulink>, <ulink url="http://www.totaltalk.com/">AOL TotalTalk</ulink> and many locally accessible providers offering the so-called <quote>full phone service</quote>. Internet phone service only is offered by <ulink url="http://www.skype.com/">Skype</ulink>, <ulink url="http://www.sipbroker.com/">SIP Broker</ulink>, <ulink url="http://www.google.com/talk/">Google</ulink> and many others.</para>
<para>If you want to set up a server of your own, you might want to look into <ulink url="http://www.asterisk.org">Asterisk</ulink>.</para>
</sect3>
<sect3 id="sect_11_05_02_02"><title>Client Side</title>
<para>On the client side, the applications that you can use depend on your network configuration. If you have a direct Internet connection, there won't be any problems, provided that you know on what server you can connect, and usually that you also have a username and password to authenticate to the service.</para>
<para>On the client<indexterm><primary>VoIP</primary><secondary>clients</secondary></indexterm> side, the applications that you can use depend on your network configuration. If you have a direct Internet connection, there won't be any problems, provided that you know on what server you can connect, and usually that you also have a username and password to authenticate to the service.</para>
<para>If you are behind a firewall that does Network Address Translation (NAT), however, some services might not work, as they will only see the IP address of the firewall and not the address of your computer, which might well be unroutable over the Internet, for instance when you are in a company network and your IP address starts with 10., 192.168. or another non-routable subnet prefix. This depends on the protocol that is used by the application.</para>
<para>Also, available bandwidth might be a blocking factor: some applications are optimized for low bandwidth consumption, while others might require high bandwidth connections. This depends on the codec that is used by the application.</para>
<para>Among the most common applications are the Skype client, which has an interface that reminds of instant messaging, and <ulink url="http://www.counterpath.com/">X-Lite</ulink>, the free version of the <application>XTen softphone</application>, which looks like a mobile telephone. However, while these programs are available for free download and very popular, they are not free as in free speech: they use proprietary protocols and/or are only available in binary packages, not in source format.</para>
@ -184,7 +184,65 @@ Aborted by signal Interrups...
</sect2>
</sect1>
<sect1 id="sect_11_03"><title>Summary</title>
<para>The GNU/Linux platform is fully multi-media enabled. A wide variety of devices like sound cards, tv-cards, headsets, microphones, CD and DVD players is supported. The list of applications is sheer endless.</para>
<para>The GNU/Linux platform is fully multi-media enabled. A wide variety of devices like sound cards, tv-cards, headsets, microphones, CD and DVD players is supported. The list of applications is sheer endless, that is why we needed to shortenthe list of new commands below and limit ourselves to general audio commands.</para>
<table frame="all">
<title>New commands in chapter 11: Audio</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Command</entry><entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><command>alsaconf</command></entry><entry>Configure the ALSA sound system.</entry>
</row>
<row>
<entry><command>alsamixer</command></entry><entry>Tune output levels of ALSA driver.</entry>
</row>
<row>
<entry><command>arecord</command></entry><entry>Record a sound sample.</entry>
</row>
<row>
<entry><command>aumix</command></entry><entry>Audio mixer tool.</entry>
</row>
<row>
<entry><command>cdp</command></entry><entry>Play an audio CD.</entry>
</row>
<row>
<entry><command>cdparanoia</command></entry><entry>Rip an audio CD.</entry>
</row>
<row>
<entry><command>cdplay</command></entry><entry>Play an audio CD.</entry>
</row>
<row>
<entry><command>gnome-alsamixer</command></entry><entry><application>Gnome</application> ALSA front-end.</entry>
</row>
<row>
<entry><command>gnome-cd</command></entry><entry><application>Gnome</application> front-end for playing audio CDs.</entry>
</row>
<row>
<entry><command>gnome-sound-recorder</command></entry><entry><application>Gnome</application> front-end for recording sound samples.</entry>
</row>
<row>
<entry><command>kaudiocreator</command></entry><entry>KDE front-end for creating audio CDs.</entry>
</row>
<row>
<entry><command>kmix</command></entry><entry>KDE front-end for sound settings.</entry>
</row>
<row>
<entry><command>krec</command></entry><entry>KDE front-end for recording sound samples.</entry>
</row>
<row>
<entry><command>mplayer</command></entry><entry>Multi-media player.</entry>
</row>
<row>
<entry><command>play</command></entry><entry>Command line tool for playing sound samples.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 id="sect_11_04"><title>Exercises</title>
<orderedlist>

View File

@ -398,7 +398,54 @@ Report bugs to &lt;bug-textutils@gnu.org&gt;.
<sect1 id="sect_02_04"><title>Summary</title>
<para>Linux traditionally operates in text mode or in graphical mode. Since CPU power and RAM are not the cost anymore these days, every Linux user can afford to work in graphical mode and will usually do so. This does not mean that you don't have to know about text mode: we will work in the text environment throughout this course, using a terminal window.</para>
<para>Linux encourages its users to acquire knowledge and to become independent. Inevitably, you will have to read a lot of documentation to achieve that goal; that is why, as you will notice, we refer to extra documentation for almost every command, tool and problem listed in this book. The more docs you read, the easier it will become and the faster you will leaf through manuals. Make reading documentation a habit as soon as possible. When you don't know the answer to a problem, refering to the documentation should become a second nature.</para>
<para>We already learned some commands:</para>
<table frame="all">
<title>New commands in chapter 2: Basics</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Command</entry><entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><command>apropos</command></entry><entry>Search information about a command or subject.</entry>
</row>
<row>
<entry><command>cat</command></entry><entry>Show content of one or more files.</entry>
</row>
<row>
<entry><command>cd</command></entry><entry>Change into another directory.</entry>
</row>
<row>
<entry><command>exit</command></entry><entry>Leave a shell session.</entry>
</row>
<row>
<entry><command>file</command></entry><entry>Get information about the content of a file.</entry>
</row>
<row>
<entry><command>info</command></entry><entry>Read <application>Info</application> pages about a command.</entry>
</row>
<row>
<entry><command>logout</command></entry><entry>Leave a shell session.</entry>
</row>
<row>
<entry><command>ls</command></entry><entry>List directory content.</entry>
</row>
<row>
<entry><command>man</command></entry><entry>Read manual pages of a command.</entry>
</row>
<row>
<entry><command>passwd</command></entry><entry>Change your password.</entry>
</row>
<row>
<entry><command>pwd</command></entry><entry>Display the current working directory.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 id="sect_02_05"><title>Exercises</title>
<para>Most of what we learn is by making mistakes and by seeing how things can go wrong. These exercises are made to get you to read some error messages. The order in which you do these exercises is important.</para>

View File

@ -1474,7 +1474,7 @@ drwxrws--- 4 root users 4096 Jul 25 2001 docs/
<para>We've made our first steps toward becoming an expert: we discussed the real and the fake structure of the file system, and we know about the Linux file security model, as well as several other security precautions that are taken on every system by default.</para>
<para>The shell is the most important tool for interaction with the system. We learned several shell commands in this chapter, which are listed in the table below.</para>
<table frame="all">
<title>New commands</title>
<title>New commands in chapter 3: Files and the file system</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
@ -1550,6 +1550,10 @@ drwxrws--- 4 root users 4096 Jul 25 2001 docs/
<row>
<entry><command>mv <filename>oldfile</filename> <filename>newfile</filename></command></entry><entry>Rename or move <filename>oldfile</filename>.</entry>
</row>
<row>
<entry><command>newgrp <parameter>groupname</parameter></command></entry><entry>Log in to a new group.</entry>
</row>
<row>
<entry><command>pwd</command></entry><entry>Print the present or current working directory.</entry>
</row>

View File

@ -758,7 +758,7 @@ crontab: installing new crontab
</sect1>
<sect1 id="sect_04_05"><title>Summary</title>
<para>Linux is a multi-user, multi-tasking operating system that has a UNIX-like way of handling processes. Execution speed of commands can depend on a thousand tiny things. Among others, we learned a lot of new commands to visualize and handle processes. Here's a list:</para>
<table frame="all"><title>Process handling commands</title>
<table frame="all"><title>New commands in chapter 4: Processes</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
@ -803,6 +803,9 @@ crontab: installing new crontab
<entry><command>nice</command></entry><entry>Run a program with modified scheduling priority.</entry>
</row>
<row>
<entry><command>pgrep</command></entry><entry>Display processes.</entry>
</row>
<row>
<entry><command>ps</command></entry><entry>Report process status.</entry>
</row>
<row>

View File

@ -266,7 +266,31 @@ My boss
<sect1 id="sect_05_04"><title>Summary</title>
<para>In this chapter we learned how commands can be linked to each other, and how input from one command can be used as output for another command.</para>
<para>Input/output redirection is a common task on UNIX and Linux machines. This powerful mechanism allows flexible use of the building blocks UNIX is made of.</para>
<para>The most commonly used redirections are <command>&gt;</command> and <command>|</command>.</para>
<para>The most commonly used redirections are <command>&gt;</command> and <command>|</command>. Refer to <xref linkend="app3" /> for an overview of redirection commands and other shell constructs.</para>
<table frame="all">
<title>New commands in chapter 5: I/O redirection</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Command</entry><entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><command>date</command></entry><entry>Display time and date information.</entry>
</row>
<row>
<entry><command>set</command></entry><entry>Configure shell options.</entry>
</row>
<row>
<entry><command>sort</command></entry><entry>Sort lines of text.</entry>
</row>
<row>
<entry><command>uniq</command></entry><entry>Remove duplicate lines from a sorted file.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 id="sect_05_05"><title>Exercises</title>
<para>These exercises give more examples on how to combine commands. The main goal is to try and use the <keycap>Enter</keycap> key as little as possible.</para>

View File

@ -583,6 +583,12 @@ export INPUTRC="/etc/inputrc"
<prompt>debby:~&gt;</prompt> <command>ps -ef | grep ntpd</command>
ntp 24678 1 0 2002 ? 00:00:33 ntpd -U ntp
</screen>
<para>You can run <command>ntpdate<indexterm><primary>ntpdate</primary></indexterm></command> manually to set the time, on condition that you can reach a time server. The <command>ntpd</command> daemon should not be running when you adjust the time using <command>ntpdate</command>. Use a time server as argument to the command:</para>
<screen>
<prompt>root@box:~# </prompt><command>ntpdate <parameter>10.2.5.200</parameter></command>
26 Oct 14:35:42 ntpdate[20364]: adjust time server 10.2.5.200 offset
-0.008049 sec
</screen>
<para>See your system manual and the documentation that comes with the NTP package. Most desktop managers include tools to set the system time, providing that you have access to the system administrator's account.</para>
<para>For setting the time zone<indexterm><primary>time zone</primary><secondary>configuration</secondary></indexterm> correct, you can use <command>tzconfig<indexterm><primary>tzconfig</primary></indexterm></command> or <command>timezone<indexterm><primary>timezone</primary></indexterm></command> commands. Timezone information is usually set during the installation of your machine. Many systems have distribution-specific tools to configure it, see your system documentation.</para>
</sect2>
@ -809,7 +815,75 @@ title old-kernel
<para>While keeping order is important, it is equally important to feel at home in your environment, whether text or graphical. The text environment is controlled through the shell setup files. The graphical environment is primarily dependent on the X server configuration, on which a number of other applications are built, such as window and desktop managers and graphical applications, each with their own config files. You should read the system and program specific documentation to find out about how to configure them.</para>
<para>Regional settings such as keyboard setup, installing appropriate fonts and language support are best done at installation time.</para>
<para>Software is managed either automatically or manually using a package system.</para>
<para>The following commands were introduced in this chapter:</para>
<table frame="all">
<title>New commands in chapter 7: Making yourself at home</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>
<entry>Command</entry><entry>Meaning</entry>
</row>
</thead>
<tbody>
<row>
<entry><command>aptitude</command></entry><entry>Manage packages Debian-style.</entry>
</row>
<row>
<entry><command>automount</command></entry><entry>automatically include newly inserted file systems.</entry>
</row>
<row>
<entry><command>dpkg</command></entry><entry>Debian package manager.</entry>
</row>
<row>
<entry><command>dselect</command></entry><entry>Manage packages Debian-style.</entry>
</row>
<row>
<entry><command>loadkeys</command></entry><entry>Load keyboard configuration.</entry>
</row>
<row>
<entry><command>lsof</command></entry><entry>Identify processes.</entry>
</row>
<row>
<entry><command>mount</command></entry><entry>Include a new file system into the existing file system tree.</entry>
</row>
<row>
<entry><command>ntpdate</command></entry><entry>Set the system time and date using a time server.</entry>
</row>
<row>
<entry><command>quota</command></entry><entry>Display information about allowed disk space usage.</entry>
</row>
<row>
<entry><command>recode</command></entry><entry>Convert files to another character set.</entry>
</row>
<row>
<entry><command>rpm</command></entry><entry>Manage RPM packages.</entry>
</row>
<row>
<entry><command>setfont</command></entry><entry>Choose a font.</entry>
</row>
<row>
<entry><command>timezone</command></entry><entry>Set the timezone.</entry>
</row>
<row>
<entry><command>tzconfig</command></entry><entry>Set the timezone.</entry>
</row>
<row>
<entry><command>ulimit</command></entry><entry>Set or display resource limits.</entry>
</row>
<row>
<entry><command>up2date</command></entry><entry>Manage RPM packages.</entry>
</row>
<row>
<entry><command>urpmi</command></entry><entry>Manage RPM packages.</entry>
</row>
<row>
<entry><command>yum</command></entry><entry>Manage RPM packages.</entry>
</row>
</tbody>
</tgroup>
</table>
</sect1>
<sect1 id="sect_07_08"><title>Exercises</title>
<sect2 id="sect_07_08_01"><title>Shell environment</title>

View File

@ -184,7 +184,7 @@ Printer: lp@blob
</sect1>
<sect1 id="sect_08_05"><title>Summary</title>
<para>The Linux print service comes with a set of printing tools based on the standard UNIX LPD tools, whether it be the SystemV or BSD implementation. Below is a list of print-related commands.</para>
<table frame="all"><title>Printing related commands</title>
<table frame="all"><title>New commands in chapter 8: Printing</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row>

View File

@ -18,11 +18,11 @@
</abstract>
<sect1 id="sect_09_01"><title>Introduction</title>
<para>Although Linux is one of the safest operating systems in existence, and even if it is designed to keep on going, data can get lost. Data loss is most often the consequence of user errors, but occasionally a system fault, such as a power failure, is the cause, so it's always a good idea to keep an extra copy of sensitive and/or important data.</para>
<para>Although Linux is one of the safest operating systems in existence, and even if it is designed to keep on going, data can get lost. Data loss is most often the consequence of user errors, but occasionally a system fault, such as a power or disk failure, is the cause, so it's always a good idea to keep an extra copy of sensitive and/or important data.</para>
<sect2 id="sect_09_01_01"><title>Preparing your data</title>
<sect3 id="sect_09_01_01_01"><title>Archiving with tar</title>
<para>In most cases, we will first collect all the data to back up in a single archive file, which we will compress later on. The process of archiving involves concatenating all listed files and taking out unnecessary blanks. In Linux, this is commonly done with the <command>tar</command> command. <command>tar</command> was originally designed to archive data on tapes, but it can also make archives, known as <emphasis>tarballs</emphasis>.</para>
<para><command>tar</command> has many options, the most important ones are cited below:</para>
<para>In most cases, we will first collect all the data to back up in a single archive file, which we will compress later on. The process of archiving<indexterm><primary>archiving</primary><secondary>tools</secondary></indexterm> involves concatenating all listed files and taking out unnecessary blanks. In Linux, this is commonly done with the <command>tar<indexterm><primary>tar</primary></indexterm></command> command. <command>tar</command> was originally designed to archive<indexterm><primary>backups</primary><secondary>tar</secondary></indexterm> data on tapes, but it can also make archives, known as <emphasis>tarballs<indexterm><primary>tarballs</primary></indexterm></emphasis>.</para>
<para><command>tar</command> has many options<indexterm><primary>tar</primary><secondary>options</secondary></indexterm>, the most important ones are cited below:</para>
<itemizedlist>
<listitem><para><option>-v</option>: verbose</para></listitem>
<listitem><para><option>-t</option>: test, shows content of a tarball</para></listitem>
@ -33,8 +33,8 @@
</itemizedlist>
<para>It is common to leave out the dash-prefix with <command>tar</command> options, as you can see from the examples below.</para>
<note><title>Use GNU tar for compatibility</title>
<para>The archives made with a proprietary <command>tar</command> version on one system, may be incompatible with <command>tar</command> on another proprietary system. This may cause much headaches, such as if the archive needs to be recovered on a system that doesn't exist anymore. Use the GNU <command>tar</command> version on all systems to prevent your system admin from bursting into tears. Linux always uses GNU tar. When working on other UNIX machines, enter <command>tar <option>--help</option></command> to find out which version you are using. Contact your system admin if you don't see the word GNU somewhere.</para></note>
<para>In the example below, an archive is created and unpacked.</para>
<para>The archives<indexterm><primary>tar</primary><secondary>GNU tar</secondary></indexterm> made with a proprietary <command>tar</command> version on one system, may be incompatible with <command>tar</command> on another proprietary system. This may cause much headaches, such as if the archive needs to be recovered on a system that doesn't exist anymore. Use the GNU <command>tar</command> version on all systems to prevent your system admin from bursting into tears. Linux always uses GNU tar. When working on other UNIX machines, enter <command>tar <option>--help</option></command> to find out which version you are using. Contact your system admin if you don't see the word GNU somewhere.</para></note>
<para>In the example below, an archive is created<indexterm><primary>tar</primary><secondary>example</secondary></indexterm> and unpacked.</para>
<screen>
<prompt>gaby:~&gt;</prompt> <command>ls images/</command>
me+tux.jpg nimf.jpg
@ -75,12 +75,12 @@ nimf.jpg
me+tux.jpg nimf.jpg
</screen>
<para>This example also illustrates the difference between a tarred directory and a bunch of tarred files. It is advisable to only compress directories, so files don't get spread all over when unpacking the tarball (which may be on another system, where you may not know which files were already there and which are the ones from the archive).</para>
<para>When a tape drive is connected to your machine and configured by your system administrator, the file names ending in <filename>.tar</filename> are replaced with the tape device name, for example:</para>
<para>When a tape drive is connected to your machine and configured by your system administrator, the file names ending in <filename>.tar</filename> are replaced with the tape<indexterm><primary>backups</primary><secondary>tape device</secondary></indexterm> device name, for example:</para>
<para><command>tar <option>cvf</option> <filename>/dev/tape</filename> <filename>mail/</filename></command></para>
<para>The directory <filename>mail</filename> and all the files it contains are compressed into a file that is written on the tape immediately. A content listing is displayed because we used the verbose option.</para>
</sect3>
<sect3 id="sect_09_01_01_02"><title>Incremental backups with tar</title>
<para>The <command>tar</command> tool supports the creation of incremental backups, using the <option>-N</option> option. With this option, you can specify a date, and <command>tar</command> will check modification time of all specified files against this date. If files are changed more recent than date, they will be included in the backup. The example below uses the timestamp on a previous archive as the date value. First, the initial archive is created and the timestamp on the initial backup file is shown. Then a new file is created, upon which we take a new backup, containing only this new file:</para>
<para>The <command>tar</command> tool supports the creation of incremental<indexterm><primary>tar</primary><secondary>incremental backups</secondary></indexterm> backups, using the <option>-N</option> option. With this option, you can specify a date, and <command>tar</command> will check modification time of all specified files against this date. If files are changed more recent than date, they will be included in the backup. The example below uses the timestamp on a previous archive as the date value. First, the initial archive is created and the timestamp on the initial backup file is shown. Then a new file is created, upon which we take a new backup, containing only this new file:</para>
<screen>
<prompt>jimmy:~&gt;</prompt> <command>tar cvpf /var/tmp/javaproggies.tar java/*.java</command>
java/btw.java
@ -136,12 +136,12 @@ work/file4
<para>These are some very simple examples, but you could also use this kind of command in a cronjob (see <xref linkend="sect_04_04_04" />), which specifies for instance a snapshot file for the weekly backup and one for the daily backup. Snapshot files should be replaced when taking full backups, in that case.</para>
<para>More information can be found in the <command>tar</command> documentation.</para>
<tip><title>The real stuff</title>
<para>As you could probably notice, <command>tar</command> is OK when we are talking about a simple directory, a set of files that belongs together. There are tools that are easier to manage, however, when you want to archive entire partitions or disks or larger projects. We just explain about <command>tar</command> here because it is a very popular tool for distributing archives. It will happen quite often that you need to install a software that comes in a so-called <quote>compressed tar ball</quote>. See <xref linkend="sect_09_03" /> for an easier way to perform regular backups.</para>
<para>As you could probably notice, <command>tar</command> is OK when we are talking about a simple directory, a set of files that belongs together. There are tools that are easier to manage, however, when you want to archive entire partitions or disks or larger projects. We just explain about <command>tar</command> here because it is a very popular tool for distributing archives. It will happen quite often that you need to install a software that comes in a so-called <quote>compressed tarball</quote>. See <xref linkend="sect_09_03" /> for an easier way to perform regular backups.</para>
</tip>
</sect3>
<sect3 id="sect_09_01_01_03"><title>Compressing and unpacking with <command>gzip</command> or <command>bzip2</command></title>
<para>
Data, including tarballs, can be compressed using zip tools. The <command>gzip</command> command will add the suffix .gz to the file name and remove the original file.
Data, including tarballs, can be compressed<indexterm><primary>files</primary><secondary>compressing</secondary></indexterm> using zip tools. The <command>gzip<indexterm><primary>gzip</primary></indexterm></command> command will add the suffix .gz to the file name and remove the original file.
</para>
<screen>
<prompt>jimmy:~&gt;</prompt> <command>ls -la | grep tar</command>
@ -152,18 +152,18 @@ Data, including tarballs, can be compressed using zip tools. The <command>gzip<
<prompt>jimmy:~&gt;</prompt> <command>ls -la images-without-dir.tar.gz </command>
-rw-rw-r-- 1 jimmy jimmy 50562 Jun 6 14:08 images-without-dir.tar.gz
</screen>
<para>Uncompress gzipped files with the <option>-d</option> option.</para>
<para><command>bzip2</command> works in a similar way, but uses an improved compression algorithm, thus creating smaller files. See the <command>bzip2</command> info pages for more.</para>
<para>Uncompress gzipped files with the <option>-d</option> option<indexterm><primary>files</primary><secondary>uncompressing</secondary></indexterm>.</para>
<para><command>bzip2<indexterm><primary>bzip2</primary></indexterm></command> works in a similar way, but uses an improved compression algorithm, thus creating smaller files. See the <command>bzip2</command> info pages for more.</para>
<para>Linux software packages are often distributed in a gzipped tarball. The sensible thing to do after unpacking that kind of archives is find the <filename>README</filename> and read it. It will generally contain guidelines to installing the package.</para>
<para>The GNU <command>tar</command> command is aware of gzipped files. Use the command</para>
<para>Linux software packages are often distributed in a gzipped tarball. The sensible thing to do after unpacking that kind of archives is find the <filename>README<indexterm><primary>README</primary></indexterm></filename> and read it. It will generally contain guidelines to installing the package.</para>
<para>The GNU <command>tar</command> command is aware of gzipped<indexterm><primary>tar</primary><secondary>compressed files</secondary></indexterm> files. Use the command</para>
<cmdsynopsis><command>tar <option>zxvf</option> <filename>file.tar.gz</filename></command></cmdsynopsis>
<para>for unzipping and untarring <filename>.tar.gz</filename> or <filename>.tgz</filename> files. Use</para>
<cmdsynopsis><command>tar <option>jxvf</option> <filename>file.tar.bz2</filename></command></cmdsynopsis>
<para>for unpacking <command>tar</command> archives that were compressed with <command>bzip2</command>.</para>
</sect3>
<sect3 id="sect_09_01_01_04"><title>Java archives</title>
<para>The GNU project provides us with the <command>jar</command> tool for creating Java archives. It is a Java application that combines multiple files into a single JAR archive file. While also being a general purpose archiving and compression tool, based on ZIP and the ZLIB compression format, <command>jar</command> was mainly designed to facilitate the packing of Java code, applets and/or applications in a single file. When combined in a single archive, the components of a Java application, can be downloaded much faster.</para>
<para>The GNU project provides us with the <command>jar<indexterm><primary>jar</primary></indexterm></command> tool for creating Java archives. It is a Java application that combines multiple files into a single JAR<indexterm><primary>archiving</primary><secondary>Java archives</secondary></indexterm> archive file. While also being a general purpose archiving and compression tool, based on ZIP and the ZLIB compression format, <command>jar</command> was mainly designed to facilitate the packing of Java code, applets and/or applications in a single file. When combined in a single archive, the components of a Java application, can be downloaded much faster.</para>
<para>Unlike <command>tar</command>, <command>jar</command> compresses by default, independent from other tools - because it is basically the Java version of <command>zip</command>. In addition, it allows individual entries in an archive to be signed by the author, so that origins can be authenticated.</para>
<para>The syntax is almost identical as for the <command>tar</command> command, we refer to <command>info <parameter>jar</parameter></command> for specific differences.</para>
<note><title>tar, jar and symbolic links</title>
@ -172,7 +172,7 @@ Data, including tarballs, can be compressed using zip tools. The <command>gzip<
</sect3>
<sect3 id="sect_09_01_01_05"><title>Transporting your data</title>
<para>Saving copies of your data on another host is a simple but accurate way of making backups. See <xref linkend="chap_10" />, Communications, for more information on <command>scp</command>, <command>ftp</command> and many more.</para>
<para>Saving copies of your data on another host is a simple but accurate way of making backups. See <xref linkend="chap_10" /> for more information on <command>scp</command>, <command>ftp</command> and more.</para>
<para>In the next section we'll discuss local backup devices.</para>
</sect3>
</sect2>
@ -182,9 +182,9 @@ Data, including tarballs, can be compressed using zip tools. The <command>gzip<
<title>Moving your data to a backup device</title>
<sect2 id="sect_09_02_01"><title>Making a copy on a floppy disk</title>
<sect3 id="sect_09_02_01_01"><title>Formatting the floppy</title>
<para>On most Linux systems, users have access to the floppy disk device. The name of the device may vary depending on the size and number of floppy drives, contact your system admin if you are unsure. On some systems, there will likely be a link <filename>/dev/floppy</filename> pointing to the right device, probably <filename>/dev/fd0</filename> (the auto-detecting floppy device) or <filename>/dev/fd0H1440</filename> (set for 1,44MB floppies).</para>
<para>On most Linux systems, users have access to the floppy disk<indexterm><primary>archiving</primary><secondary>floppies</secondary></indexterm> device. The name of the device may vary depending on the size and number of floppy drives, contact your system admin if you are unsure. On some systems, there will likely be a link <filename>/dev/floppy</filename> pointing to the right device, probably <filename>/dev/fd0</filename> (the auto-detecting floppy device) or <filename>/dev/fd0H1440</filename> (set for 1,44MB floppies).</para>
<para>
<command>fdformat</command> is the low-level floppy disk formatting tool. It has the device name of the floppy disk as an option. <command>fdformat</command> will display an error when the floppy is write-protected.
<command>fdformat<indexterm><primary>fdformat</primary></indexterm></command> is the low-level floppy disk formatting tool. It has the device name of the floppy disk as an option. <command>fdformat</command> will display an error when the floppy is write-protected.
</para>
<screen>
<prompt>emma:~&gt;</prompt> <command>fdformat /dev/fd0H1440</command>
@ -193,7 +193,7 @@ Formatting ... done
Verifying ... done
<prompt>emma:~&gt;</prompt>
</screen>
<para>The <command>mformat</command> command (from the mtools package) is used to create DOS-compatible floppies which can then be accessed using the <command>mcopy</command>, <command>mdir</command> and other m-commands.</para>
<para>The <command>mformat<indexterm><primary>mformat</primary></indexterm></command> command (from the mtools package) is used to create DOS-compatible floppies which can then be accessed using the <command>mcopy</command>, <command>mdir</command> and other m-commands.</para>
<para>Graphical tools are also available.</para>
<figure><title>Floppy formatter</title>
<mediaobject>
@ -207,10 +207,10 @@ Verifying ... done
</mediaobject>
</figure>
<para>After the floppy is formatted, it can be mounted into the file system and accessed as a normal, be it small, directory, usually via the <filename>/mnt/floppy</filename> entry.</para>
<para>Should you need it, install the <command>mkbootdisk</command> utility, which makes a floppy from which the current system can boot.</para>
<para>Should you need it, install the <command>mkbootdisk<indexterm><primary>mkbootdisk</primary></indexterm></command> utility, which makes a floppy from which the current system can boot.</para>
</sect3>
<sect3 id="sect_09_02_01_02"><title>Using the <command>dd</command> command to dump data</title>
<para>The <command>dd</command> command can be used to put data on a disk, or get it off again, depending on the given input and output devices. An example:</para>
<para>The <command>dd<indexterm><primary>archiving</primary><secondary>dd</secondary></indexterm></command> command can be used to put data on a disk, or get it off again, depending on the given input and output devices. An example<indexterm><primary>dd</primary></indexterm>:</para>
<screen>
<prompt>gaby:~&gt;</prompt> <command>dd if=images-without-dir.tar.gz of=/dev/fd0H1440</command>
98+1 records in
@ -231,7 +231,7 @@ Verifying ... done
</sect3>
</sect2>
<sect2 id="sect_09_02_02"><title>Making a copy with a CD-writer</title>
<para>On some systems users are allowed to use the CD-writer device. Your data will need to be formatted first. Use the <command>mkisofs</command> command to do this in the directory containing the files you want to backup. Check with <command>df</command> that enough disk space is available, because a new file about the same size as the entire current directory will be created:</para>
<para>On some systems users are allowed to use the CD-writer<indexterm><primary>archiving</primary><secondary>CD-writer</secondary></indexterm> device. Your data will need to be formatted first. Use the <command>mkisofs<indexterm><primary>mkisofs</primary></indexterm></command> command to do this in the directory containing the files you want to backup. Check with <command>df<indexterm><primary>df</primary></indexterm></command> that enough disk space is available, because a new file<indexterm><primary>CD images</primary><secondary>mkisofs example</secondary></indexterm> about the same size as the entire current directory will be created:</para>
<screen>
<prompt>[rose@blob recordables]</prompt> <command>df -h .</command>
Filesystem Size Used Avail Use% Mounted on
@ -252,7 +252,7 @@ Path table size(bytes): 452
Max brk space used 37e84
166768 extents written (325 Mb)
</screen>
<para>The <option>-J</option> and <option>-r</option> options are used to make the CD-ROM mountable on different systems, see the man pages for more. After that, the CD can be created using the <command>cdrecord</command> tool with appropriate options:</para>
<para>The <option>-J</option> and <option>-r</option> options are used to make the CD-ROM mountable on different systems, see the man pages for more. After<indexterm><primary>CD burning</primary><secondary>command line tools</secondary></indexterm> that, the CD<indexterm><primary>archiving</primary><secondary>burning a CD</secondary></indexterm> can be created using the <command>cdrecord<indexterm><primary>cdrecord</primary></indexterm></command> tool with appropriate options:</para>
<screen>
<prompt>[rose@blob recordables]</prompt> <command>cdrecord -dev 0,0,0 -speed=8 cd.iso</command>
Cdrecord 1.10 (i686-pc-linux-gnu) (C) 1995-2001 Joerg Schilling
@ -273,23 +273,23 @@ Starting to write CD/DVD at speed 4 in write mode for single session.
Last chance to quit, starting real write in 0 seconds.
Operation starts.
</screen>
<para>Depending on your CD-writer, you now have the time to smoke a cigarette and/or get a cup of coffee. Upon finishing the job, you will get a confirmation message:</para>
<para>Depending on your CD-writer, you now have the time to smoke^H^H^H^H^H eat a healthy piece of fruit and/or get a cup of coffee. Upon finishing the job, you will get a confirmation message:</para>
<screen>
Track 01: Total bytes read/written: 341540864/341540864
(166768 sectors).
</screen>
<para>There are some graphical tools available to make it easier on you. One of the popular ones is <command>xcdroast</command>, which is freely available from <ulink url="http://www.xcdroast.org/">the X-CD-Roast web site</ulink> and is included on most systems and in the GNU directory. Both the KDE and Gnome desktop managers have facilities to make your own CDs.</para>
<para>There are some graphical tools available to make it easier on you. One of the popular ones is <command>xcdroast<indexterm><primary>CD burning</primary><secondary>graphical tools</secondary></indexterm></command>, which is freely available from <ulink url="http://www.xcdroast.org/">the X-CD-Roast web site<indexterm><primary>xcdroast</primary></indexterm></ulink> and is included on most systems and in the GNU directory. Both the KDE and Gnome desktop managers have facilities to make your own CDs.</para>
</sect2>
<sect2 id="sect_09_02_03"><title>Backups on/from jazz drives, USB devices and such</title>
<para>These devices are usually mounted into the file system. After the mount procedure, they are accessed as normal directories, so you can use the standard commands for manipulating files.</para>
<para>In the example below, images are copied from a USB camera to the hard disk:</para>
<para>In the example below, images are copied from a USB<indexterm><primary>archiving</primary><secondary>USB devices</secondary></indexterm> camera to the hard disk:</para>
<screen>
<prompt>robin:~&gt;</prompt> <command>mount <filename>/mnt/camera</filename></command>
<prompt>robin:~&gt;</prompt> <command>mount | grep <parameter>camera</parameter></command>
/dev/sda1 on /mnt/camera type vfat (rw,nosuid,nodev)
</screen>
<para>If the camera is the only USB storage device that you ever connect to your system, this is safe. But keep in mind that USB devices are assigned entries in <filename>/dev</filename> as they are connected to the system. Thus, if you first connect a USB stick to your system, it will be on the <filename>/dev/sda</filename> entry, and if you connect your camera after that, it will be assigned to <filename>/dev/sdb</filename> - provided that you do not have any SCSI disks, which are also on <filename>/dev/sd*</filename>. On newer systems, since kernel 2.6, a hotplug system called HAL (Hardware Abstraction Layer) ensures that users don't have to deal with this burden. If you want to check where your device is, type <command>dmesg</command> after inserting it.</para>
<para>If the camera<indexterm><primary>camera</primary><secondary>mounting</secondary></indexterm> is the only USB storage device that you ever connect to your system, this is safe. But keep in mind that USB devices are assigned entries in <filename>/dev</filename> as they are connected to the system. Thus, if you first connect a USB stick to your system, it will be on the <filename>/dev/sda</filename> entry, and if you connect your camera after that, it will be assigned to <filename>/dev/sdb</filename> - provided that you do not have any SCSI disks, which are also on <filename>/dev/sd*</filename>. On newer systems, since kernel 2.6, a hotplug system called HAL (Hardware Abstraction Layer) ensures that users don't have to deal with this burden. If you want to check where your device is, type <command>dmesg<indexterm><primary>USB</primary><secondary>dmesg</secondary></indexterm></command> after inserting<indexterm><primary>dmesg</primary></indexterm> it.</para>
<para>You can now copy the files:</para>
<screen>
<prompt>robin:~&gt;</prompt> <command>cp -R /mnt/camera/* images/</command>
@ -297,19 +297,19 @@ Track 01: Total bytes read/written: 341540864/341540864
<prompt>robin:~&gt;</prompt> <command>umount /mnt/camera</command>
</screen>
<para>Likewise, a jazz drive may be mounted on <filename>/mnt/jazz</filename>.</para>
<para>Appropriate lines should be added in <filename>/etc/modules.conf</filename> and <filename>/etc/fstab</filename> to make this work. Refer to specific hardware HOWTOs for more information. On systems with a 2.6.x kernel or higher, you may also want to check the man pages for <command>modprobe</command> and <filename>modprobe.conf</filename>.</para>
<para>Appropriate lines should be added in <filename>/etc/modules.conf<indexterm><primary>modules.conf</primary></indexterm></filename> and <filename>/etc/fstab<indexterm><primary>fstab</primary></indexterm></filename> to make this work. Refer to specific hardware HOWTOs for more information. On systems with a 2.6.x kernel or higher, you may also want to check the man pages for <command>modprobe</command> and <filename>modprobe.conf</filename>.</para>
</sect2>
<sect2 id="sect_09_02_04"><title>Backing up data using a tape device</title>
<para>This is done using <command>tar</command> (see above). The <command>mt</command> tool is used for controlling the magnetic tape device, like <filename>/dev/st0</filename>. Entire books have been written about tape backup, therefore, refer to our reading-list in <xref linkend="app2" /> for more information. Keep in mind that databases might need other backup procedures because of their architecture.</para>
<para>This is done using <command>tar</command> (see above). The <command>mt<indexterm><primary>mt</primary></indexterm></command> tool is used for controlling the magnetic tape<indexterm><primary>archiving</primary><secondary>tapes</secondary></indexterm> device, like <filename>/dev/st0</filename>. Entire books have been written about tape backup, therefore, refer to our reading-list in <xref linkend="app2" /> for more information. Keep in mind that databases might need other backup procedures because of their architecture.</para>
<para>The appropriate backup commands are usually put in one of the <emphasis>cron</emphasis> directories in order to have them executed on a regular basis. In larger environments, the freely available <ulink url="http://www.amanda.org">Amanda</ulink> backup suite or a commercial solution may be implemented to back up multiple machines. Working with tapes, however, is a system administration task beyond the scope of this document.</para>
</sect2>
<sect2 id="sect_09_02_05"><title>Tools from your distribution</title>
<para>Most Linux distributions offer their own tools for making your life easy. A short overview:</para>
<para>Most Linux distributions offer their own tools<indexterm><primary>backups</primary><secondary>tools</secondary></indexterm> for making your life easy. A short overview:</para>
<itemizedlist>
<listitem><para>SuSE: YaST now includes expanded backup and restore modules.</para></listitem>
<listitem><para>RedHat: the File Roller tool provides visual management of (compressed) archives. They seem to be in favour of the X-CD-Roast tool for moving backups to an external device.</para></listitem>
<listitem><para>SuSE: <application>YaST</application> now includes expanded backup and restore modules.</para></listitem>
<listitem><para>RedHat: the <application>File Roller</application> tool provides visual management of (compressed) archives. They seem to be in favour of the X-CD-Roast tool for moving backups to an external device.</para></listitem>
<listitem><para>Mandrake: X-CD-Roast.</para></listitem>
<listitem><para>Most distributions come with the BSD <command>dump</command> and <command>restore</command> utilities for making backups of <emphasis>ext2</emphasis> and <emphasis>ext3</emphasis> file systems. This tool can write to a variety of devices and literally dumps the file(s) or file system bit per bit onto the specified device. Like <command>dd</command>, this allows for backing up special file types such as the ones in <filename>/dev</filename>.</para></listitem>
<listitem><para>Most distributions come with the BSD <command>dump<indexterm><primary>dump</primary></indexterm></command> and <command>restore<indexterm><primary>restore</primary></indexterm></command> utilities for making backups of <emphasis>ext2</emphasis> and <emphasis>ext3</emphasis> file systems. This tool can write to a variety of devices and literally dumps the file(s) or file system bit per bit onto the specified device. Like <command>dd</command>, this allows for backing up special file types such as the ones in <filename>/dev</filename>.</para></listitem>
</itemizedlist>
</sect2>
@ -317,10 +317,10 @@ Track 01: Total bytes read/written: 341540864/341540864
<sect1 id="sect_09_03"><title>Using rsync</title>
<sect2 id="sect_09_03_01"><title>Introduction</title>
<para>The <command>rsync</command> program is a fast and flexible tool for remote backup. It is common on UNIX and UNIX-like systems, easy to configure and use in scripts. While the <emphasis>r</emphasis> in <command>rsync</command> stands for <quote>remote</quote>, you do not need to take this all too literally. Your <quote>remote</quote> device might just as well be a USB storage device or another partition on your hard disk, you do not need to have two separated machines.</para>
<para>The <command>rsync<indexterm><primary>rsync</primary></indexterm></command> program is a fast and flexible tool for remote backup<indexterm><primary>backups</primary><secondary>rsync</secondary></indexterm>. It is common on UNIX and UNIX-like systems, easy to configure and use in scripts. While the <emphasis>r</emphasis> in <command>rsync</command> stands for <quote>remote</quote>, you do not need to take this all too literally. Your <quote>remote</quote> device might just as well be a USB storage device or another partition on your hard disk, you do not need to have two separated machines.</para>
</sect2>
<sect2 id="sect_09_03_02"><title>An example: rsync to a USB storage device</title>
<para>As discussed in <xref linkend="sect_03_01_02_03" />, we will first have to mount the device. This is done as <emphasis>root</emphasis>:</para>
<para>As discussed in <xref linkend="sect_03_01_02_03" />, we will first have to mount<indexterm><primary>USB</primary><secondary>mount device</secondary></indexterm> the device. Possibly, this should be done as <emphasis>root</emphasis>:</para>
<screen>
<prompt>root@theserver# </prompt><command>mkdir <filename>/mnt/usbstore</filename></command>
@ -340,15 +340,15 @@ Track 01: Total bytes read/written: 341540864/341540864
<sect1 id="sect_09_04"><title>Encryption</title>
<sect2 id="sect_09_04_01"><title>General remarks</title>
<sect3 id="sect_09_04_01_01"><title>Why should you encrypt data?</title>
<para>Encryption is synonym to secrecy. In the context of backups, encryption can be very useful, for instance if you need to leave your backed up data in a place where you can not control access, such as the server of your provider.</para>
<para>Encryption<indexterm><primary>encryption</primary><secondary>why?</secondary></indexterm> is synonym to secrecy. In the context of backups, encryption can be very useful, for instance if you need to leave your backed up data in a place where you can not control access, such as the server of your provider.</para>
<para>Apart from that, encryption can be applied to E-mails as well: normally, mail is not encrypted and it is often sent in the open over the netwerk or the Internet. If your message contains sensitive information, better encrypt it.</para>
</sect3>
<sect3 id="sect_09_04_01_02"><title>GNU Privacy Guard</title>
<para>On Linux systems you will find <application>GnuPG</application>, the GNU Privacy Guard</application>, which is a suite of programs that are compatible with the PGP (<application>Pretty Good Privacy</application>) tools that are commercially available.</para>
<para>On Linux systems you will find <application>GnuPG</application>, the GNU Privacy Guard<indexterm><primary>encryption</primary><secondary>GnuPG</secondary></indexterm></application>, which is a suite of programs that are compatible with the PGP (<application>Pretty Good Privacy</application>) tools that are commercially available.</para>
<para>In this guide we will only discuss the very simple usage of the encryption tools and show what you will need in order to generate an encryption key and use it to encrypt data for yourself, which you can then safely store in a public place. More advanced usage directions can be found in the man pages of the various commands.</para>
</sect3>
<sect2 id="sect_09_04_02"><title>Generate a key</title>
<para>Before you can start encrypting your data, you need to create a pair of keys. The pair consists of a private and a public key. You can send the public key to correspondents, who can use it to encrypt data for you, which you decrypt with your private key. You always keep the private key, never share it with somebody else, or they will be able to decrypt data that is only destined for you. Just to make sure that no accidents happen, the private key is protected with a password. The key pair is created using this command:</para>
<para>Before you can start encrypting your data, you need to create<indexterm><primary>encryption</primary><secondary>generate keys</secondary></indexterm> a pair of keys. The pair consists of a private and a public key. You can send the public key to correspondents, who can use it to encrypt data for you, which you decrypt with your private key. You always keep the private key, never share it with somebody else, or they will be able to decrypt data that is only destined for you. Just to make sure that no accidents happen, the private key is protected with a password. The key pair is created using this command<indexterm><primary>gpg</primary></indexterm>:</para>
<screen>
<prompt>willy@ubuntu:~$ </prompt><command>gpg <option>--key-gen</option></command>
gpg (GnuPG) 1.4.2.2; Copyright (C) 2005 Free Software Foundation, Inc.
@ -400,8 +400,8 @@ Passphrase:
<para>Now the key pair is generated by a program that spawns random numbers and that is, among other factors, fed with the activity data of the system. So it is a good idea to start some programs now, to move the mouse cursor or to type some random characters in a terminal window. That way, the chances to generate a number that contains lots of different digits will be much bigger and the key will be more difficult to crack.</para>
</sect2>
<sect2 id="sect_09_04_03"><title>About your key</title>
<para>When your key has been created, you will get a message about the <emphasis>fingerprint</emphasis>. This is a sequence of 40 hexadecimal numbers, which is so long that it is very, very hard to generate the same key twice, on any computer. You can be rather sure that this is a unique sequence. The short form of this key consists of your name, followed by the last 8 hexadecimal numbers.</para>
<para>You can get information about your key as follows:</para>
<para>When your key has been created, you will get a message about the <emphasis>fingerprint<indexterm><primary>fingerprint</primary></indexterm></emphasis>. This is a sequence of 40 hexadecimal<indexterm><primary>encryption</primary><secondary>fingerprint</secondary></indexterm> numbers, which is so long that it is very, very hard to generate the same key twice, on any computer. You can be rather sure that this is a unique sequence. The short form of this key consists of your name, followed by the last 8 hexadecimal numbers.</para>
<para>You can get information about your key as follows<indexterm><primary>encryption</primary><secondary>searching keys</secondary></indexterm>:</para>
<screen>
<prompt>willy@ubuntu:~$ </prompt><command>gpg <option>--list-keys</option></command>
/home/willy/.gnupg/pubring.gpg
@ -410,12 +410,12 @@ pub 1024D/BF5C3DBB 2006-08-08
uid Willy De Wandel (Willem) &lt;wdw@mvg.vl&gt;
sub 4096g/A3449CF7 2006-08-08
</screen>
<para>The <emphasis>key ID</emphasis> of this key is <quote>BF5C3DBB</quote>. You can send your key ID and your name to a <emphasis>key server</emphasis>, so that other people can get this info about you and use it to encrypt data for you. Alternatively, you can send your public key directly to the people who need it. The public part of your key is the long series of numbers that you see when using the <option>--export</option> option to the <command>gpg</command> command:</para>
<para>The <emphasis>key ID</emphasis> of this key<indexterm><primary>encryption</primary><secondary>key ID</secondary></indexterm> is <quote>BF5C3DBB</quote>. You can send your key ID and your name to a <emphasis>key server</emphasis>, so that other people can get this info about you and use it to encrypt data for you. Alternatively, you can send your public key directly to the people who need it. The public part of your key is the long series of numbers that you see when using the <option>--export</option> option<indexterm><primary>encryption</primary><secondary>export public key</secondary></indexterm> to the <command>gpg</command> command:</para>
<cmdsynopsis><command>gpg <option>--export -a</option></command></cmdsynopsis>
<para>However, as far is this guide is concerned, we assume that you only need your key in order to encrypt and decrypt data for yourself. Read the <command>gpg</command> man pages if you want to know more.</para>
</sect2>
<sect2 id="sect_09_04_04"><title>Encrypt data</title>
<para>Now you can encrypt a <filename>.tar</filename> archive or a compressed archive, prior to saving it to a backup medium or transporting it to the backup server. Use the <command>gpg</command> command like this:</para>
<para>Now you can encrypt a <filename>.tar</filename> archive<indexterm><primary>files</primary><secondary>encrypting</secondary></indexterm> or a compressed archive, prior to saving it to a backup medium or transporting it to the backup server. Use the <command>gpg</command> command<indexterm><primary>encryption</primary><secondary>creating encrypted files</secondary></indexterm> like this:</para>
<cmdsynopsis><command>gpg <option>-e -r</option> <parameter>(part of) uid</parameter> <filename>archive</filename></command></cmdsynopsis>
<para>The <option>-e</option> option tells <command>gpg</command> to encrypt, the <option>-r</option> option indicates who to encrypt for. Keep in mind that only only the user name(s) following this <option>-r</option> option will be able to decrypt the data again. An example:</para>
<screen>
@ -423,7 +423,7 @@ sub 4096g/A3449CF7 2006-08-08
</screen>
</sect2>
<sect2 id="sect_09_04_05"><title>Decrypting files</title>
<para>Using the <option>-d</option> option, you can decrypt files that have been encrypted for you. The data will scroll over your screen, but an encrypted copy will remain on disk. So for file formats other than plain text, you will want to save the decrypted data, so that you can view them with the appropriate program. This is done using the <option>-o</option> option to the <command>gpg</command> command:</para>
<para>Using the <option>-d</option> option, you can decrypt<indexterm><primary>files</primary><secondary>decrypting</secondary></indexterm> files that have been encrypted<indexterm><primary>encryption</primary><secondary>decrypting</secondary></indexterm> for you. The data will scroll over your screen, but an encrypted copy will remain on disk. So for file formats other than plain text, you will want to save the decrypted data, so that you can view them with the appropriate program. This is done using the <option>-o</option> option to the <command>gpg</command> command:</para>
<screen>
<prompt>willy@ubuntu:~$ </prompt><command>gpg <option>-d -o</option> <filename>/var/tmp/home-willy-decrypt.tar /var/tmp/home-willy-20060808.tar.gpg</filename></command>
@ -444,7 +444,7 @@ gpg: encrypted with 4096-bit ELG-E key, ID A3449CF7, created 2006-08-08
<sect1 id="sect_09_05"><title>Summary</title>
<para>Here's a list of the commands involving file backup:</para>
<table frame="all"><title>Backup commands</title>
<table frame="all"><title>New commands in chapter 9: Backup</title>
<tgroup cols="2" align="left" colsep="1" rowsep="1">
<thead>
<row><entry>Command</entry><entry>Meaning</entry></row>