DocBook SGML corrections

Commented out an <inlinemediaobject/> which was using processing instructions
(IGNORE/INCLUDE) to control selection of several <imageobject/> children and
one <textobject/> child; jade got confused because there was no <imageobject/>
being selected, only a <textobject/> so refused to process the document

Also, cleaned up some stray </listitem> and missing <emphasis> elements
throughout the document.  Squashed one stray </chapter> ending the
bibliography and removed an attribute (title=) that was forbidden on a
<bibliography/> element.
This commit is contained in:
Martin A. Brown 2016-01-24 01:04:43 -08:00
parent 44fc82d10d
commit b84ac99768
2 changed files with 37 additions and 41 deletions

View File

@ -103,7 +103,7 @@ Updated document with new grammatical review. Re-ordered the entire Text section
<date>20th April 2004</date> <date>20th April 2004</date>
<authorinitials>GA</authorinitials> <authorinitials>GA</authorinitials>
<revremark> <revremark>
Attempted to fix document according to TLDP criticisms. Added notes and tips more sectioning. Now complying to the open group standards for the <productname>UNIX</productname> system trademark. Document should be ready for TLDP site. <remark>Attempted to fix document according to TLDP criticisms. Added notes and tips more sectioning. Now complying to the open group standards for the <productname>UNIX</productname> system trademark. Document should be ready for TLDP site.</remark>
</revremark> </revremark>
</revision> </revision>
<revision> <revision>
@ -154,10 +154,9 @@ This is the initial draft release (the first release to be converted from LyX to
<screen>enable -a</screen> <screen>enable -a</screen>
</para> </para>
</tip> </tip>
</sect1>
<sect1 id="who-would-want-to-read-this-guide"><title>Who would want to read this guide?</title><para>Anyone who is interested in learning <indexterm><primary>learning</primary></indexterm>about the tools (also known as commands) available to them when using their GNU/Linux based operating system.</para><para>Why would you want to learn <indexterm><primary>learn</primary></indexterm>how to use the command-line<indexterm><primary>command-line</primary></indexterm> (and available tools)? The <emphasis>C</emphasis>ommand <emphasis>L</emphasis>ine<emphasis>-I</emphasis>nterface (CLI)<indexterm><primary>CLI</primary></indexterm><indexterm><primary>command line-interface</primary></indexterm>, while difficult to learn, is the quickest <indexterm><primary>quickest</primary></indexterm>and most efficient <indexterm><primary>efficient</primary></indexterm>way to use a computer for many different tasks. The CLI <indexterm><primary>CLI</primary></indexterm>is the normal method of use for most <productname>UNIX</productname> <indexterm><primary>UNIX system</primary></indexterm>system administrators,<indexterm><primary>administrators</primary></indexterm> programmers <indexterm><primary>programmers</primary></indexterm>and some power users<indexterm><primary>power users</primary></indexterm>. While a <acronym>GUI</acronym> <indexterm><primary>GUI</primary></indexterm>is better suited <indexterm><primary>suited</primary></indexterm>to some tasks, many operations are best suited to the CLI.<indexterm><primary>CLI</primary></indexterm></para><para>The major motivation<indexterm><primary>motivation</primary></indexterm> behind learning <indexterm><primary>learning</primary></indexterm>the GNU/Linux CLI <indexterm><primary>CLI</primary></indexterm>is the authors <indexterm><primary>authors</primary></indexterm>idea<indexterm><primary>idea</primary></indexterm> that, with software <indexterm><primary>software</primary></indexterm>in general, the more time spent learning something equals less time spent performing that particular task <emphasis>(authors opinion only<indexterm><primary>authors opinion</primary></indexterm>)</emphasis>.</para><para>This guide is aimed at beginners<indexterm><primary>beginners</primary></indexterm> to intermediate <indexterm><primary>intermediate</primary></indexterm>users who want to learn<indexterm><primary>learn</primary></indexterm> about the command-line <indexterm><primary>command-line</primary></indexterm>tools available to them. Advanced users may wish to use it as a command reference,<indexterm><primary>reference</primary></indexterm> however this document aims to list <indexterm><primary>list</primary></indexterm>commands of interest, as judged <indexterm><primary>judged</primary></indexterm>by the authors opinion,<indexterm><primary>authors opinion</primary></indexterm> it is not designed <indexterm><primary>designed</primary></indexterm>to be completely comprehensive,<indexterm><primary>comprehensive</primary></indexterm> see the appendix,<indexterm><primary>appendix</primary></indexterm> <xref linkend="general-further-reading"> for further information. Or if you are not looking for a command reference <indexterm><primary>reference</primary></indexterm>guide, but a more gentle introduction to GNU/Linux you may be interested in the <ulink url="http://www.tldp.org/LDP/intro-linux/html/">Introduction to <productname>Linux</productname> guide</ulink><indexterm><primary>Introduction to <productname>Linux</productname> guide</primary></indexterm> authored <indexterm><primary>authored</primary></indexterm>by Machtelt Garrels.<indexterm><primary>Machtelt Garrels</primary></indexterm></para><para>This guide could also be considered a summarised <indexterm><primary>summarised</primary></indexterm>version of the <productname>Linux</productname> Cookbook.<indexterm><primary>Linux Cookbook</primary></indexterm> If you are looking for a book <indexterm><primary>book</primary></indexterm>with more detailed descriptions of each tool have a look at the <ulink url="http://dsl.org/cookbook/">Linux Cookbook Homepage</ulink>, also check out the <ulink url="http://www.onlamp.com/linux/cmd/">command list from "Linux in a Nutshell 3rd Edition"</ulink><indexterm><primary>command list</primary></indexterm><indexterm><primary>Linux in a Nutshell 3rd Edition</primary></indexterm> for an index <indexterm><primary>index</primary></indexterm>of 300+ commands and their explanations.<indexterm><primary>explanations</primary></indexterm></para></sect1> <sect1 id="who-would-want-to-read-this-guide"><title>Who would want to read this guide?</title><para>Anyone who is interested in learning <indexterm><primary>learning</primary></indexterm>about the tools (also known as commands) available to them when using their GNU/Linux based operating system.</para><para>Why would you want to learn <indexterm><primary>learn</primary></indexterm>how to use the command-line<indexterm><primary>command-line</primary></indexterm> (and available tools)? The <emphasis>C</emphasis>ommand <emphasis>L</emphasis>ine<emphasis>-I</emphasis>nterface (CLI)<indexterm><primary>CLI</primary></indexterm><indexterm><primary>command line-interface</primary></indexterm>, while difficult to learn, is the quickest <indexterm><primary>quickest</primary></indexterm>and most efficient <indexterm><primary>efficient</primary></indexterm>way to use a computer for many different tasks. The CLI <indexterm><primary>CLI</primary></indexterm>is the normal method of use for most <productname>UNIX</productname> <indexterm><primary>UNIX system</primary></indexterm>system administrators,<indexterm><primary>administrators</primary></indexterm> programmers <indexterm><primary>programmers</primary></indexterm>and some power users<indexterm><primary>power users</primary></indexterm>. While a <acronym>GUI</acronym> <indexterm><primary>GUI</primary></indexterm>is better suited <indexterm><primary>suited</primary></indexterm>to some tasks, many operations are best suited to the CLI.<indexterm><primary>CLI</primary></indexterm></para><para>The major motivation<indexterm><primary>motivation</primary></indexterm> behind learning <indexterm><primary>learning</primary></indexterm>the GNU/Linux CLI <indexterm><primary>CLI</primary></indexterm>is the authors <indexterm><primary>authors</primary></indexterm>idea<indexterm><primary>idea</primary></indexterm> that, with software <indexterm><primary>software</primary></indexterm>in general, the more time spent learning something equals less time spent performing that particular task <emphasis>(authors opinion only<indexterm><primary>authors opinion</primary></indexterm>)</emphasis>.</para><para>This guide is aimed at beginners<indexterm><primary>beginners</primary></indexterm> to intermediate <indexterm><primary>intermediate</primary></indexterm>users who want to learn<indexterm><primary>learn</primary></indexterm> about the command-line <indexterm><primary>command-line</primary></indexterm>tools available to them. Advanced users may wish to use it as a command reference,<indexterm><primary>reference</primary></indexterm> however this document aims to list <indexterm><primary>list</primary></indexterm>commands of interest, as judged <indexterm><primary>judged</primary></indexterm>by the authors opinion,<indexterm><primary>authors opinion</primary></indexterm> it is not designed <indexterm><primary>designed</primary></indexterm>to be completely comprehensive,<indexterm><primary>comprehensive</primary></indexterm> see the appendix,<indexterm><primary>appendix</primary></indexterm> <xref linkend="general-further-reading"> for further information. Or if you are not looking for a command reference <indexterm><primary>reference</primary></indexterm>guide, but a more gentle introduction to GNU/Linux you may be interested in the <ulink url="http://www.tldp.org/LDP/intro-linux/html/">Introduction to <productname>Linux</productname> guide</ulink><indexterm><primary>Introduction to <productname>Linux</productname> guide</primary></indexterm> authored <indexterm><primary>authored</primary></indexterm>by Machtelt Garrels.<indexterm><primary>Machtelt Garrels</primary></indexterm></para><para>This guide could also be considered a summarised <indexterm><primary>summarised</primary></indexterm>version of the <productname>Linux</productname> Cookbook.<indexterm><primary>Linux Cookbook</primary></indexterm> If you are looking for a book <indexterm><primary>book</primary></indexterm>with more detailed descriptions of each tool have a look at the <ulink url="http://dsl.org/cookbook/">Linux Cookbook Homepage</ulink>, also check out the <ulink url="http://www.onlamp.com/linux/cmd/">command list from "Linux in a Nutshell 3rd Edition"</ulink><indexterm><primary>command list</primary></indexterm><indexterm><primary>Linux in a Nutshell 3rd Edition</primary></indexterm> for an index <indexterm><primary>index</primary></indexterm>of 300+ commands and their explanations.<indexterm><primary>explanations</primary></indexterm></para></sect1>
<sect1 id="who-would-not-want-to-read-this-guide"><title>Who would not want to read this guide?</title><para>Anyone who is not interested in the command-line<indexterm><primary>command-line</primary></indexterm>, or anyone looking for a detailed reference to all available GNU/Linux tools should look elsewhere. This is only a summary,<indexterm><primary>summary</primary></indexterm> while it does list many commands, it's not a complete<indexterm><primary>complete</primary></indexterm> listing <indexterm><primary>listing</primary></indexterm>(I don't think it's possible to make a complete listing anyway).</para><para>This document would not be of interest to those who already have an expert <indexterm><primary>expert</primary></indexterm>knowledge <indexterm><primary>knowledge</primary></indexterm>of the command-line interface <indexterm><primary>command-line interface</primary></indexterm>and do require any reference <indexterm><primary>reference</primary></indexterm>information.<indexterm><primary>information</primary></indexterm> Or those readers <indexterm><primary>readers</primary></indexterm>who require detailed <indexterm><primary>detailed</primary></indexterm>lists <indexterm><primary>lists</primary></indexterm>of options <indexterm><primary>options</primary></indexterm>for each command, the man pages<indexterm><primary>man pages</primary></indexterm> are better suited <indexterm><primary>suited</primary></indexterm>to this purpose.<indexterm><primary>purpose</primary></indexterm></para></sect1> <sect1 id="who-would-not-want-to-read-this-guide"><title>Who would not want to read this guide?</title><para>Anyone who is not interested in the command-line<indexterm><primary>command-line</primary></indexterm>, or anyone looking for a detailed reference to all available GNU/Linux tools should look elsewhere. This is only a summary,<indexterm><primary>summary</primary></indexterm> while it does list many commands, it's not a complete<indexterm><primary>complete</primary></indexterm> listing <indexterm><primary>listing</primary></indexterm>(I don't think it's possible to make a complete listing anyway).</para><para>This document would not be of interest to those who already have an expert <indexterm><primary>expert</primary></indexterm>knowledge <indexterm><primary>knowledge</primary></indexterm>of the command-line interface <indexterm><primary>command-line interface</primary></indexterm>and do require any reference <indexterm><primary>reference</primary></indexterm>information.<indexterm><primary>information</primary></indexterm> Or those readers <indexterm><primary>readers</primary></indexterm>who require detailed <indexterm><primary>detailed</primary></indexterm>lists <indexterm><primary>lists</primary></indexterm>of options <indexterm><primary>options</primary></indexterm>for each command, the man pages<indexterm><primary>man pages</primary></indexterm> are better suited <indexterm><primary>suited</primary></indexterm>to this purpose.<indexterm><primary>purpose</primary></indexterm></para></sect1>
<sect1 id="sources-of-document"><title>Availability of sources</title><para>The modifiable <indexterm><primary>modifiable</primary></indexterm>sources <indexterm><primary>sources</primary></indexterm>of the original <indexterm><primary>original</primary></indexterm>book <indexterm><primary>book</primary></indexterm>(in english), are available<indexterm><primary>available</primary></indexterm> in LyX <indexterm><primary>LyX</primary></indexterm>format <indexterm><primary>format</primary></indexterm>(LyX Document Processor) or Machine-translated <indexterm><primary>Machine-translated</primary></indexterm>SGML <indexterm><primary>SGML</primary></indexterm>(SGML markup language<indexterm><primary>markup language</primary></indexterm>). </para><para>LyX is a completely free document processor <indexterm><primary>document processor</primary></indexterm>based on LaTeX,<indexterm><primary>LaTeX</primary></indexterm> downloadable<indexterm><primary>downloadable</primary></indexterm> from <ulink url="http://www.lyx.org">the LyX homepage.</ulink>.</para><para>See <xref linkend="formats"> for the modifiable <indexterm><primary>modifiable</primary></indexterm>sources <indexterm><primary>sources</primary></indexterm>of this document. These are the official <indexterm><primary>official</primary></indexterm>versions.<indexterm><primary>versions</primary></indexterm> We (the translators <indexterm><primary>translators</primary></indexterm>and current maintainers<indexterm><primary>maintainers</primary></indexterm>) plan to continue work on this document and add new chapters and enhancements.<indexterm><primary>enhancements</primary></indexterm> If you want to see the version <indexterm><primary>version</primary></indexterm>we are currently working on (the &quot;bleeding edge&quot; version), check the <ulink url="http://www.karakas-online.de/gnu-linux-tools-summary/">GNU/Linux Command-Line Tools Summary Homepage</ulink><indexterm><primary>GNU/Linux Tools Summary Homepage</primary></indexterm> from time to time (kindly hosted <indexterm><primary>hosted</primary></indexterm>by <ulink url="http://www.karakas-online.de">Chris Karakas</ulink><indexterm><primary>Chris Karakas</primary></indexterm>).</para></sect1> <sect1 id="sources-of-document"><title>Availability of sources</title><para>The modifiable <indexterm><primary>modifiable</primary></indexterm>sources <indexterm><primary>sources</primary></indexterm>of the original <indexterm><primary>original</primary></indexterm>book <indexterm><primary>book</primary></indexterm>(in english), are available<indexterm><primary>available</primary></indexterm> in LyX <indexterm><primary>LyX</primary></indexterm>format <indexterm><primary>format</primary></indexterm>(LyX Document Processor) or Machine-translated <indexterm><primary>Machine-translated</primary></indexterm>SGML <indexterm><primary>SGML</primary></indexterm>(SGML markup language<indexterm><primary>markup language</primary></indexterm>). </para><para>LyX is a completely free document processor <indexterm><primary>document processor</primary></indexterm>based on LaTeX,<indexterm><primary>LaTeX</primary></indexterm> downloadable<indexterm><primary>downloadable</primary></indexterm> from <ulink url="http://www.lyx.org">the LyX homepage.</ulink>.</para><para>See <!-- <xref linkend="formats"> --> for the modifiable <indexterm><primary>modifiable</primary></indexterm>sources <indexterm><primary>sources</primary></indexterm>of this document. These are the official <indexterm><primary>official</primary></indexterm>versions.<indexterm><primary>versions</primary></indexterm> We (the translators <indexterm><primary>translators</primary></indexterm>and current maintainers<indexterm><primary>maintainers</primary></indexterm>) plan to continue work on this document and add new chapters and enhancements.<indexterm><primary>enhancements</primary></indexterm> If you want to see the version <indexterm><primary>version</primary></indexterm>we are currently working on (the &quot;bleeding edge&quot; version), check the <ulink url="http://www.karakas-online.de/gnu-linux-tools-summary/">GNU/Linux Command-Line Tools Summary Homepage</ulink><indexterm><primary>GNU/Linux Tools Summary Homepage</primary></indexterm> from time to time (kindly hosted <indexterm><primary>hosted</primary></indexterm>by <ulink url="http://www.karakas-online.de">Chris Karakas</ulink><indexterm><primary>Chris Karakas</primary></indexterm>).</para></sect1>
<sect1 id="conventions"><title>Conventions used in this guide</title><para>The following conventions <indexterm><primary>conventions</primary></indexterm>are used within this guide:</para><variablelist><varlistentry><term>italic <sect1 id="conventions"><title>Conventions used in this guide</title><para>The following conventions <indexterm><primary>conventions</primary></indexterm>are used within this guide:</para><variablelist><varlistentry><term>italic
</term><listitem><para><indexterm><primary>italic</primary></indexterm>Anything appearing in italic, <emphasis>like&nbsp;this </emphasis>is either an executable <indexterm><primary>executable</primary></indexterm>command or emphasized <indexterm><primary>emphasized</primary></indexterm>text. Tools (executable commands) are in italics <indexterm><primary>italics</primary></indexterm>to prevent confusion. Some tools have names which are real english <indexterm><primary>english</primary></indexterm>words, such as the &ldquo;locate&rdquo; tool.</para></listitem></varlistentry><varlistentry><term>key&nbsp;combinations </term><listitem><para><indexterm><primary>italic</primary></indexterm>Anything appearing in italic, <emphasis>like&nbsp;this </emphasis>is either an executable <indexterm><primary>executable</primary></indexterm>command or emphasized <indexterm><primary>emphasized</primary></indexterm>text. Tools (executable commands) are in italics <indexterm><primary>italics</primary></indexterm>to prevent confusion. Some tools have names which are real english <indexterm><primary>english</primary></indexterm>words, such as the &ldquo;locate&rdquo; tool.</para></listitem></varlistentry><varlistentry><term>key&nbsp;combinations
</term><listitem><para><indexterm><primary>key combinations</primary></indexterm>Are represented by using a '-' (dash sign)<indexterm><primary>dash sign</primary></indexterm> in-between the key(s), which must be used in combination.<indexterm><primary>combination</primary></indexterm> All combinations <indexterm><primary>combinations</primary></indexterm>are also printed <indexterm><primary>printed</primary></indexterm>in italics <indexterm><primary>italics</primary></indexterm>to improve clarity.<indexterm><primary>clarity</primary></indexterm> For example </term><listitem><para><indexterm><primary>key combinations</primary></indexterm>Are represented by using a '-' (dash sign)<indexterm><primary>dash sign</primary></indexterm> in-between the key(s), which must be used in combination.<indexterm><primary>combination</primary></indexterm> All combinations <indexterm><primary>combinations</primary></indexterm>are also printed <indexterm><primary>printed</primary></indexterm>in italics <indexterm><primary>italics</primary></indexterm>to improve clarity.<indexterm><primary>clarity</primary></indexterm> For example
@ -207,7 +206,7 @@ This will inform you of something that you shouldn't do (because it probably wil
<title>Note</title> <title>Note</title>
<para>Note that some tools do not accept options.</para> <para>Note that some tools do not accept options.</para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>wildcards </listitem></varlistentry><varlistentry><term>wildcards
</term><listitem><para><indexterm><primary>wildcards</primary></indexterm>Also note that most commands, even when not explicitly <indexterm><primary>explicitly</primary></indexterm>stated, will work with standard wildcards <indexterm><primary>standard wildcards</primary></indexterm> (or globbing patterns<indexterm><primary>globbing patterns</primary></indexterm>) such as *, [A-Z] and various other standard wildcards. Refer <indexterm><primary>Refer</primary></indexterm>to <xref linkend="standard-wildcards"> for further information.</para></listitem></varlistentry><varlistentry><term>access&nbsp;keys </term><listitem><para><indexterm><primary>wildcards</primary></indexterm>Also note that most commands, even when not explicitly <indexterm><primary>explicitly</primary></indexterm>stated, will work with standard wildcards <indexterm><primary>standard wildcards</primary></indexterm> (or globbing patterns<indexterm><primary>globbing patterns</primary></indexterm>) such as *, [A-Z] and various other standard wildcards. Refer <indexterm><primary>Refer</primary></indexterm>to <xref linkend="standard-wildcards"> for further information.</para></listitem></varlistentry><varlistentry><term>access&nbsp;keys
</term><listitem><para><indexterm><primary>access keys</primary></indexterm>Access keys enable <indexterm><primary>enable</primary></indexterm>navigation through the document, without relying on a mouse.<indexterm><primary>mouse</primary></indexterm> The following keys have been given special <indexterm><primary>special</primary></indexterm>meaning in this document:</para><variablelist><varlistentry><term>P </term><listitem><para><indexterm><primary>access keys</primary></indexterm>Access keys enable <indexterm><primary>enable</primary></indexterm>navigation through the document, without relying on a mouse.<indexterm><primary>mouse</primary></indexterm> The following keys have been given special <indexterm><primary>special</primary></indexterm>meaning in this document:</para><variablelist><varlistentry><term>P
</term><listitem><para>Previous <indexterm><primary>Previous</primary></indexterm>page.<indexterm><primary>page</primary></indexterm></para></listitem></varlistentry><varlistentry><term>N </term><listitem><para>Previous <indexterm><primary>Previous</primary></indexterm>page.<indexterm><primary>page</primary></indexterm></para></listitem></varlistentry><varlistentry><term>N
@ -235,7 +234,7 @@ to come back. In other browsers such as IE6, the access keys just give focus to
</keycombo> </keycombo>
<keycap>Enter</keycap> <keycap>Enter</keycap>
</keycombo> </keycombo>
. Try it, you'll like it! <inlinemediaobject> <![ %output.print.png; [ <imageobject> <imagedata fileref="icon_smile.png" format="PNG"> </imageobject> ]]> <![ %output.print.pdf; [ <imageobject> <imagedata fileref="icon_smile.pdf" format="PDF" scale="65"> </imageobject> ]]> <![ %output.print.eps; [ <imageobject> <imagedata fileref="icon_smile.eps" format="EPS"> </imageobject> ]]> <![ %output.print.bmp; [ <imageobject> <imagedata fileref="icon_smile.bmp" format="BMP"> </imageobject> ]]> <textobject> <phrase>Inline graphic</phrase> </textobject> </inlinemediaobject></para> . Try it, you'll like it! <!-- <inlinemediaobject> <![ %output.print.png; [ <imageobject> <imagedata fileref="icon_smile.png" format="PNG"/> </imageobject> ]]> <![ %output.print.pdf; [ <imageobject> <imagedata fileref="icon_smile.pdf" format="PDF" scale="65"/> </imageobject> ]]> <![ %output.print.eps; [ <imageobject> <imagedata fileref="icon_smile.eps" format="EPS"/> </imageobject> ]]> <![ %output.print.bmp; [ <imageobject> <imagedata fileref="icon_smile.bmp" format="BMP"/> </imageobject> ]]> <textobject> <phrase>Inline graphic</phrase> </textobject> </inlinemediaobject> --></para>
</sect1> </sect1>
<sect1 id="resources-used-to-create-this-document"><title>Resources used to create this document </title><para>To create the GNU/Linux Command-Line <indexterm><primary>Command-Line</primary></indexterm>Tools Summary,<indexterm><primary>Summary</primary></indexterm> I used <ulink url="http://www.lyx.org">LyX</ulink>, the document processor.<indexterm><primary>document processor</primary></indexterm> To convert <indexterm><primary>convert</primary></indexterm>the LyX files to DocBook <indexterm><primary>DocBook</primary></indexterm>SGML <indexterm><primary>SGML</primary></indexterm>I used the <ulink url="http://www.karakas-online.de/mySGML/">lyxtox Scripts</ulink><indexterm><primary>lyxtox</primary></indexterm> created by <ulink url="http://www.karakas-online.de">Chris Karakas</ulink><indexterm><primary>Chris Karakas</primary></indexterm>.</para><para>You may also want to check out the <ulink url="http://bgu.chez.tiscali.fr/">db2lyx </ulink><indexterm><primary>db2lyx</primary></indexterm> package,<indexterm><primary>package</primary></indexterm> created by Dr. B Guillion<indexterm><primary>Dr. B. Guillion</primary></indexterm>, which can be used to convert LyX files to XML <indexterm><primary>XML</primary></indexterm>DocBook and XML DocBook <indexterm><primary>DocBook</primary></indexterm>back to LyX. </para><para>I also had assistance <indexterm><primary>assistance</primary></indexterm>from various <ulink url="http://www.tldp.org">The <productname>Linux</productname> Documentation Project</ulink><indexterm><primary>The <productname>Linux</productname> Documentation Project</primary></indexterm> volunteers <indexterm><primary>volunteers</primary></indexterm>(see the contributors <indexterm><primary>contributors</primary></indexterm>section <indexterm><primary>section</primary></indexterm><xref linkend="contributors"> for specific <indexterm><primary>specific</primary></indexterm>details).</para></sect1> <sect1 id="resources-used-to-create-this-document"><title>Resources used to create this document </title><para>To create the GNU/Linux Command-Line <indexterm><primary>Command-Line</primary></indexterm>Tools Summary,<indexterm><primary>Summary</primary></indexterm> I used <ulink url="http://www.lyx.org">LyX</ulink>, the document processor.<indexterm><primary>document processor</primary></indexterm> To convert <indexterm><primary>convert</primary></indexterm>the LyX files to DocBook <indexterm><primary>DocBook</primary></indexterm>SGML <indexterm><primary>SGML</primary></indexterm>I used the <ulink url="http://www.karakas-online.de/mySGML/">lyxtox Scripts</ulink><indexterm><primary>lyxtox</primary></indexterm> created by <ulink url="http://www.karakas-online.de">Chris Karakas</ulink><indexterm><primary>Chris Karakas</primary></indexterm>.</para><para>You may also want to check out the <ulink url="http://bgu.chez.tiscali.fr/">db2lyx </ulink><indexterm><primary>db2lyx</primary></indexterm> package,<indexterm><primary>package</primary></indexterm> created by Dr. B Guillion<indexterm><primary>Dr. B. Guillion</primary></indexterm>, which can be used to convert LyX files to XML <indexterm><primary>XML</primary></indexterm>DocBook and XML DocBook <indexterm><primary>DocBook</primary></indexterm>back to LyX. </para><para>I also had assistance <indexterm><primary>assistance</primary></indexterm>from various <ulink url="http://www.tldp.org">The <productname>Linux</productname> Documentation Project</ulink><indexterm><primary>The <productname>Linux</productname> Documentation Project</primary></indexterm> volunteers <indexterm><primary>volunteers</primary></indexterm>(see the contributors <indexterm><primary>contributors</primary></indexterm>section <indexterm><primary>section</primary></indexterm><xref linkend="contributors"> for specific <indexterm><primary>specific</primary></indexterm>details).</para></sect1>
<sect1 id="feedback"><title>Feedback</title><para>Feedback <indexterm><primary>Feedback</primary></indexterm>is necessary for the advancement <indexterm><primary>advancement</primary></indexterm>of this guide. Positive,<indexterm><primary>Positive</primary></indexterm> constructive criticism <indexterm><primary>criticism</primary></indexterm>is encouraged.<indexterm><primary>encouraged</primary></indexterm> If you have ideas,<indexterm><primary>ideas</primary></indexterm> suggestions,<indexterm><primary>suggestions</primary></indexterm> advice,<indexterm><primary>advice</primary></indexterm> or problems <indexterm><primary>problems</primary></indexterm>with this guide, please send <indexterm><primary>send</primary></indexterm>an email <indexterm><primary>email</primary></indexterm>to the author <indexterm><primary>author</primary></indexterm><ulink url="mailto:somecsstudent(at)gmail.com">Gareth Anderson</ulink><indexterm><primary>Gareth Anderson</primary></indexterm>. </para><important> <sect1 id="feedback"><title>Feedback</title><para>Feedback <indexterm><primary>Feedback</primary></indexterm>is necessary for the advancement <indexterm><primary>advancement</primary></indexterm>of this guide. Positive,<indexterm><primary>Positive</primary></indexterm> constructive criticism <indexterm><primary>criticism</primary></indexterm>is encouraged.<indexterm><primary>encouraged</primary></indexterm> If you have ideas,<indexterm><primary>ideas</primary></indexterm> suggestions,<indexterm><primary>suggestions</primary></indexterm> advice,<indexterm><primary>advice</primary></indexterm> or problems <indexterm><primary>problems</primary></indexterm>with this guide, please send <indexterm><primary>send</primary></indexterm>an email <indexterm><primary>email</primary></indexterm>to the author <indexterm><primary>author</primary></indexterm><ulink url="mailto:somecsstudent(at)gmail.com">Gareth Anderson</ulink><indexterm><primary>Gareth Anderson</primary></indexterm>. </para><important>
@ -377,7 +376,7 @@ Typing: <emphasis>echo command(s) </emphasis>could<emphasis> </emphasis>save you
Using <emphasis>echo</emphasis> allows you to expand the wildcards to understand what will happen before you actually run the command. Using <emphasis>echo</emphasis> allows you to expand the wildcards to understand what will happen before you actually run the command.
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry></variablelist></sect1> </listitem></varlistentry></variablelist></sect1>
<sect1 id="the-command-line-history"><title>The command-line history</title><variablelist><varlistentry><term>Using&nbsp;the&nbsp;command&nbsp;history <sect1 id="the-command-line-history"><title>The command-line history</title><variablelist><varlistentry><term>Using&nbsp;the&nbsp;command&nbsp;history
</term><listitem><para><indexterm><primary>command history</primary></indexterm>Use the up and down key's to scroll <indexterm><primary>scroll</primary></indexterm>through previously typed commands. Press [Enter] to execute <indexterm><primary>execute</primary></indexterm>them or use the left and right arrow <indexterm><primary>arrow</primary></indexterm>keys to edit<indexterm><primary>edit</primary></indexterm> the command first. Also see <emphasis>history</emphasis> (below).</para></listitem></varlistentry><varlistentry><term>The&nbsp;history&nbsp;command </term><listitem><para><indexterm><primary>command history</primary></indexterm>Use the up and down key's to scroll <indexterm><primary>scroll</primary></indexterm>through previously typed commands. Press [Enter] to execute <indexterm><primary>execute</primary></indexterm>them or use the left and right arrow <indexterm><primary>arrow</primary></indexterm>keys to edit<indexterm><primary>edit</primary></indexterm> the command first. Also see <emphasis>history</emphasis> (below).</para></listitem></varlistentry><varlistentry><term>The&nbsp;history&nbsp;command
</term><listitem><para>The<emphasis> history <indexterm><primary>history</primary></indexterm></emphasis> command can be used to list Bash's log <indexterm><primary>log</primary></indexterm>of the commands you have typed:</para><para>This log <indexterm><primary>log</primary></indexterm>is called the &ldquo;history&rdquo;. To access <indexterm><primary>access</primary></indexterm>it type:</para><screen><![CDATA[history n </term><listitem><para>The<emphasis> history <indexterm><primary>history</primary></indexterm></emphasis> command can be used to list Bash's log <indexterm><primary>log</primary></indexterm>of the commands you have typed:</para><para>This log <indexterm><primary>log</primary></indexterm>is called the &ldquo;history&rdquo;. To access <indexterm><primary>access</primary></indexterm>it type:</para><screen><![CDATA[history n
@ -605,7 +604,7 @@ man 2 time
This will show you the man page called time in section 2, the equivalent page in section 1 is completely different This will show you the man page called time in section 2, the equivalent page in section 1 is completely different
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>man&nbsp;-K&nbsp;keyword </listitem></varlistentry><varlistentry><term>man&nbsp;-K&nbsp;keyword
</term><listitem><para><indexterm><primary>man -K</primary></indexterm>Search the manual <indexterm><primary>manual</primary></indexterm>pages for a string,<indexterm><primary>string</primary></indexterm> as in it will search<indexterm><primary>search</primary></indexterm> all manual <indexterm><primary>manual</primary></indexterm>pages for a particular string within each individual <indexterm><primary>individual</primary></indexterm>man page, it will then prompt <indexterm><primary>prompt</primary></indexterm>whether you would like to view <indexterm><primary>view</primary></indexterm>each page it will find. Use double <indexterm><primary>double</primary></indexterm>quotes &ldquo; and &rdquo; if there are spaces <indexterm><primary>spaces</primary></indexterm>in the string you are typing.</para><caution> </term><listitem><para><indexterm><primary>man -K</primary></indexterm>Search the manual <indexterm><primary>manual</primary></indexterm>pages for a string,<indexterm><primary>string</primary></indexterm> as in it will search<indexterm><primary>search</primary></indexterm> all manual <indexterm><primary>manual</primary></indexterm>pages for a particular string within each individual <indexterm><primary>individual</primary></indexterm>man page, it will then prompt <indexterm><primary>prompt</primary></indexterm>whether you would like to view <indexterm><primary>view</primary></indexterm>each page it will find. Use double <indexterm><primary>double</primary></indexterm>quotes &ldquo; and &rdquo; if there are spaces <indexterm><primary>spaces</primary></indexterm>in the string you are typing.</para><caution>
<title>Speed issue</title> <title>Speed issue</title>
<para> Please be warned that this method is going to be really, really slow. You are searching *all* man pages for a string </para> <para> Please be warned that this method is going to be really, really slow. You are searching *all* man pages for a string </para>
@ -631,7 +630,7 @@ This will show you the man page called time in section 2, the equivalent page in
<title>Equivalent to...</title> <title>Equivalent to...</title>
<para> <emphasis>apropos</emphasis> is the same as doing <emphasis>man -k</emphasis> (lowercase k).</para> <para> <emphasis>apropos</emphasis> is the same as doing <emphasis>man -k</emphasis> (lowercase k).</para>
</note> </note>
</listitem></listitem></varlistentry></variablelist><note> </listitem></varlistentry></variablelist><note>
<title>Please note</title> <title>Please note</title>
<para> <para>
You need to run <emphasis>makewhatis</emphasis> (as root) so <emphasis>whatis</emphasis>, <emphasis>man -f </emphasis>and <emphasis>apropos </emphasis>will work. You need to run <emphasis>makewhatis</emphasis> (as root) so <emphasis>whatis</emphasis>, <emphasis>man -f </emphasis>and <emphasis>apropos </emphasis>will work.
@ -696,7 +695,7 @@ Using a program with the <emphasis>-?</emphasis>,<indexterm><primary>-?</primary
The back-quote key is usually located at the same place as the tilde, above the [Tab] key. The back-quote key is usually located at the same place as the tilde, above the [Tab] key.
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>Method&nbsp;Two&nbsp;(dollars&nbsp;sign)<anchor id="command-substitution-dollars-sign"></term> </listitem></varlistentry><varlistentry><term>Method&nbsp;Two&nbsp;(dollars&nbsp;sign)<anchor id="command-substitution-dollars-sign"></term>
<listitem><para>&nbsp;</para><para>Simply type:</para><screen><![CDATA[command_1 $(command_2) <listitem><para>&nbsp;</para><para>Simply type:</para><screen><![CDATA[command_1 $(command_2)
]]></screen><para>This will execute &ldquo;command_2&rdquo; and it's output will become the input to &ldquo;command_1&rdquo;.</para></listitem></varlistentry><varlistentry><term>Using&nbsp;the&nbsp;pipe&nbsp;instead<anchor id="command-substitution-pipe"></term> ]]></screen><para>This will execute &ldquo;command_2&rdquo; and it's output will become the input to &ldquo;command_1&rdquo;.</para></listitem></varlistentry><varlistentry><term>Using&nbsp;the&nbsp;pipe&nbsp;instead<anchor id="command-substitution-pipe"></term>
<listitem><para>&nbsp;</para><para>You can of course use pipes <indexterm><primary>pipes</primary></indexterm>to do the same thing, if you don't know what a pipe <indexterm><primary>pipe</primary></indexterm>is, please see <xref linkend="usage-input-output">. For example instead of doing:</para><screen><![CDATA[less $cat file1.txt file2.txt <listitem><para>&nbsp;</para><para>You can of course use pipes <indexterm><primary>pipes</primary></indexterm>to do the same thing, if you don't know what a pipe <indexterm><primary>pipe</primary></indexterm>is, please see <xref linkend="usage-input-output">. For example instead of doing:</para><screen><![CDATA[less $cat file1.txt file2.txt
@ -712,7 +711,7 @@ The back-quote key is usually located at the same place as the tilde, above the
<title>More than two commands</title> <title>More than two commands</title>
<para>You can continue to use ';' (semicolon) characters to do more and more commands on the one line.</para> <para>You can continue to use ';' (semicolon) characters to do more and more commands on the one line.</para>
</tip> </tip>
</listitem></listitem></varlistentry></variablelist></sect1> </listitem></varlistentry></variablelist></sect1>
</chapter> </chapter>
<chapter id="Working-with-the-file-system"><title>Working with the file-system</title><para>The working with the file-system <indexterm><primary>file-system</primary></indexterm>chapter explains a number <indexterm><primary>number</primary></indexterm>of commands that you use to move around the file system <indexterm><primary>file system</primary></indexterm>hierarchy <indexterm><primary>hierarchy</primary></indexterm>and manipulate <indexterm><primary>manipulate</primary></indexterm>the files. Also explained are finding <indexterm><primary>finding</primary></indexterm>files and how to mass-rename <indexterm><primary>mass-rename</primary></indexterm>files.</para><sect1 id="using-filesystem"><title>Moving around the filesystem</title><variablelist><varlistentry><term>cd <chapter id="Working-with-the-file-system"><title>Working with the file-system</title><para>The working with the file-system <indexterm><primary>file-system</primary></indexterm>chapter explains a number <indexterm><primary>number</primary></indexterm>of commands that you use to move around the file system <indexterm><primary>file system</primary></indexterm>hierarchy <indexterm><primary>hierarchy</primary></indexterm>and manipulate <indexterm><primary>manipulate</primary></indexterm>the files. Also explained are finding <indexterm><primary>finding</primary></indexterm>files and how to mass-rename <indexterm><primary>mass-rename</primary></indexterm>files.</para><sect1 id="using-filesystem"><title>Moving around the filesystem</title><variablelist><varlistentry><term>cd
</term><listitem><para><indexterm><primary>cd</primary></indexterm>Change directory. Use <emphasis>&ldquo; cd ..&rdquo;</emphasis> to go up one directory. </para><para>One dot <indexterm><primary>dot</primary></indexterm>'.' represents <indexterm><primary>represents</primary></indexterm>the current directory <indexterm><primary>current directory</primary></indexterm>while two dots <indexterm><primary>dots</primary></indexterm>'..' represent<indexterm><primary>represent</primary></indexterm> the parent directory.<indexterm><primary>parent directory</primary></indexterm> </para><para><emphasis>&ldquo; cd -&rdquo;</emphasis> will return <indexterm><primary>return</primary></indexterm>you to the previous <indexterm><primary>previous</primary></indexterm>directory (a bit like an &ldquo;undo&rdquo;). </para><para>You can also use <emphasis>cd absolute&nbsp;path</emphasis> or <emphasis>cd relative&nbsp;path</emphasis> (see below):</para><variablelist><varlistentry><term>Absolute&nbsp;paths </term><listitem><para><indexterm><primary>cd</primary></indexterm>Change directory. Use <emphasis>&ldquo; cd ..&rdquo;</emphasis> to go up one directory. </para><para>One dot <indexterm><primary>dot</primary></indexterm>'.' represents <indexterm><primary>represents</primary></indexterm>the current directory <indexterm><primary>current directory</primary></indexterm>while two dots <indexterm><primary>dots</primary></indexterm>'..' represent<indexterm><primary>represent</primary></indexterm> the parent directory.<indexterm><primary>parent directory</primary></indexterm> </para><para><emphasis>&ldquo; cd -&rdquo;</emphasis> will return <indexterm><primary>return</primary></indexterm>you to the previous <indexterm><primary>previous</primary></indexterm>directory (a bit like an &ldquo;undo&rdquo;). </para><para>You can also use <emphasis>cd absolute&nbsp;path</emphasis> or <emphasis>cd relative&nbsp;path</emphasis> (see below):</para><variablelist><varlistentry><term>Absolute&nbsp;paths
@ -731,7 +730,7 @@ The back-quote key is usually located at the same place as the tilde, above the
Depending on how your aliases (see <xref linkend="Shell-Tips">) are setup you can also use <emphasis>l</emphasis>, <emphasis>la</emphasis> (list all) and <emphasis>ll</emphasis> (list long) to perform the above commands Depending on how your aliases (see <xref linkend="Shell-Tips">) are setup you can also use <emphasis>l</emphasis>, <emphasis>la</emphasis> (list all) and <emphasis>ll</emphasis> (list long) to perform the above commands
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>pwd </listitem></varlistentry><varlistentry><term>pwd
</term><listitem><para><indexterm><primary>pwd</primary></indexterm>Print working directory<indexterm><primary>print working directory</primary></indexterm>. Print <indexterm><primary>Print</primary></indexterm>the absolute <indexterm><primary>absolute</primary></indexterm>(complete) path <indexterm><primary>path</primary></indexterm>to the directory the user is currently in. </para><para>Command syntax:</para><screen><![CDATA[pwd </term><listitem><para><indexterm><primary>pwd</primary></indexterm>Print working directory<indexterm><primary>print working directory</primary></indexterm>. Print <indexterm><primary>Print</primary></indexterm>the absolute <indexterm><primary>absolute</primary></indexterm>(complete) path <indexterm><primary>path</primary></indexterm>to the directory the user is currently in. </para><para>Command syntax:</para><screen><![CDATA[pwd
]]></screen><para>This will tell you the full path <indexterm><primary>path</primary></indexterm>to the directory you are in, for example it may output <indexterm><primary>output</primary></indexterm>&ldquo;/usr/local/bin&rdquo; if you are currently in that directory.</para></listitem></varlistentry><varlistentry><term>tree ]]></screen><para>This will tell you the full path <indexterm><primary>path</primary></indexterm>to the directory you are in, for example it may output <indexterm><primary>output</primary></indexterm>&ldquo;/usr/local/bin&rdquo; if you are currently in that directory.</para></listitem></varlistentry><varlistentry><term>tree
</term><listitem><para><indexterm><primary>tree</primary></indexterm>Outputs <indexterm><primary>Outputs</primary></indexterm>an <acronym>ASCII</acronym> <indexterm><primary>ASCII</primary></indexterm>text tree/graph <indexterm><primary>graph</primary></indexterm>starting at a given directory (by default <indexterm><primary>default</primary></indexterm>the current <indexterm><primary>current</primary></indexterm>directory). This command recursively lists <indexterm><primary>lists</primary></indexterm>all files and all directories.<indexterm><primary>directories</primary></indexterm></para><para>In other words, it will list files within the directories <indexterm><primary>directories</primary></indexterm>below the current one, as well as all files in the current directory.</para><para><emphasis>tree</emphasis> has a large number of options, refer <indexterm><primary>refer</primary></indexterm>to the manual <indexterm><primary>manual</primary></indexterm>page <indexterm><primary>page</primary></indexterm>for details.<indexterm><primary>details</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[tree </term><listitem><para><indexterm><primary>tree</primary></indexterm>Outputs <indexterm><primary>Outputs</primary></indexterm>an <acronym>ASCII</acronym> <indexterm><primary>ASCII</primary></indexterm>text tree/graph <indexterm><primary>graph</primary></indexterm>starting at a given directory (by default <indexterm><primary>default</primary></indexterm>the current <indexterm><primary>current</primary></indexterm>directory). This command recursively lists <indexterm><primary>lists</primary></indexterm>all files and all directories.<indexterm><primary>directories</primary></indexterm></para><para>In other words, it will list files within the directories <indexterm><primary>directories</primary></indexterm>below the current one, as well as all files in the current directory.</para><para><emphasis>tree</emphasis> has a large number of options, refer <indexterm><primary>refer</primary></indexterm>to the manual <indexterm><primary>manual</primary></indexterm>page <indexterm><primary>page</primary></indexterm>for details.<indexterm><primary>details</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[tree
@ -772,8 +771,8 @@ command_to_be_executed <co id="command"> then '{}'<emphasis> </emphasis>(curly
You need to run either <emphasis>updatedb</emphasis> (as root) or <emphasis>slocate -u<indexterm><primary>-u</primary></indexterm> </emphasis>(as root) for slocate to work. You need to run either <emphasis>updatedb</emphasis> (as root) or <emphasis>slocate -u<indexterm><primary>-u</primary></indexterm> </emphasis>(as root) for slocate to work.
</para> </para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>whereis<emphasis> </listitem></varlistentry><varlistentry><term><emphasis>whereis</emphasis>
</term><listitem><para>whereis<indexterm><primary>whereis</primary></indexterm></emphasis> locates <indexterm><primary>locates</primary></indexterm>the binary,<indexterm><primary>binary</primary></indexterm> source,<indexterm><primary>source</primary></indexterm> and manual page for a particular program, it uses exact <indexterm><primary>exact</primary></indexterm>matches only, if you only know part <indexterm><primary>part</primary></indexterm>of the name use <emphasis>slocate</emphasis><indexterm><primary>slocate</primary></indexterm>.</para><para>Command syntax:</para><screen><![CDATA[whereis program_name </term><listitem><para>whereis<indexterm><primary><emphasis>whereis</emphasis></primary></indexterm> locates <indexterm><primary>locates</primary></indexterm>the binary,<indexterm><primary>binary</primary></indexterm> source,<indexterm><primary>source</primary></indexterm> and manual page for a particular program, it uses exact <indexterm><primary>exact</primary></indexterm>matches only, if you only know part <indexterm><primary>part</primary></indexterm>of the name use <emphasis>slocate</emphasis><indexterm><primary>slocate</primary></indexterm>.</para><para>Command syntax:</para><screen><![CDATA[whereis program_name
]]></screen></listitem></varlistentry><varlistentry><term>which ]]></screen></listitem></varlistentry><varlistentry><term>which
</term><listitem><para><indexterm><primary>which</primary></indexterm>Virtually the same as whereis,<indexterm><primary>whereis</primary></indexterm> except it only finds <indexterm><primary>finds</primary></indexterm>the executable<indexterm><primary>executable</primary></indexterm> (the physical <indexterm><primary>physical</primary></indexterm>program). It only looks in the PATH <indexterm><primary>PATH</primary></indexterm>(environment variable) of a users shell.<indexterm><primary>shell</primary></indexterm> </para><para>Use the <emphasis>-a<indexterm><primary>-a</primary></indexterm></emphasis> option to list all occurances <indexterm><primary>occurances</primary></indexterm>of the particular program_name <indexterm><primary>program_name</primary></indexterm>in your path<indexterm><primary>path</primary></indexterm> (so if theres more than one you can see it).</para><para>Command syntax:</para><screen><![CDATA[which program_name </term><listitem><para><indexterm><primary>which</primary></indexterm>Virtually the same as whereis,<indexterm><primary>whereis</primary></indexterm> except it only finds <indexterm><primary>finds</primary></indexterm>the executable<indexterm><primary>executable</primary></indexterm> (the physical <indexterm><primary>physical</primary></indexterm>program). It only looks in the PATH <indexterm><primary>PATH</primary></indexterm>(environment variable) of a users shell.<indexterm><primary>shell</primary></indexterm> </para><para>Use the <emphasis>-a<indexterm><primary>-a</primary></indexterm></emphasis> option to list all occurances <indexterm><primary>occurances</primary></indexterm>of the particular program_name <indexterm><primary>program_name</primary></indexterm>in your path<indexterm><primary>path</primary></indexterm> (so if theres more than one you can see it).</para><para>Command syntax:</para><screen><![CDATA[which program_name
]]></screen></listitem></varlistentry></variablelist></sect2> ]]></screen></listitem></varlistentry></variablelist></sect2>
@ -793,7 +792,7 @@ You need to run either <emphasis>updatedb</emphasis> (as root) or <emphasis>sloc
On some systems such as <productname>Mandrake</productname> an alias will send <emphasis>rm</emphasis> to <emphasis>rm -i<indexterm><primary>-i</primary></indexterm></emphasis> (prompting you for every file you wish to delete). To override this use: <emphasis>\rm -R directory </emphasis>(using the \ disables the alias for this run only) On some systems such as <productname>Mandrake</productname> an alias will send <emphasis>rm</emphasis> to <emphasis>rm -i<indexterm><primary>-i</primary></indexterm></emphasis> (prompting you for every file you wish to delete). To override this use: <emphasis>\rm -R directory </emphasis>(using the \ disables the alias for this run only)
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>rmdir </listitem></varlistentry><varlistentry><term>rmdir
</term><listitem><para><indexterm><primary>rmdir</primary></indexterm>Remove an empty <indexterm><primary>empty</primary></indexterm>directory. If you want to remove <indexterm><primary>remove</primary></indexterm>a directory with files in it type &ldquo; rm -R directory&rdquo;, read above for information <indexterm><primary>information</primary></indexterm>on<emphasis> rm -R</emphasis></para><para>Command syntax:</para><screen><![CDATA[rmdir directory </term><listitem><para><indexterm><primary>rmdir</primary></indexterm>Remove an empty <indexterm><primary>empty</primary></indexterm>directory. If you want to remove <indexterm><primary>remove</primary></indexterm>a directory with files in it type &ldquo; rm -R directory&rdquo;, read above for information <indexterm><primary>information</primary></indexterm>on<emphasis> rm -R</emphasis></para><para>Command syntax:</para><screen><![CDATA[rmdir directory
]]></screen><para>This will only remove <indexterm><primary>remove</primary></indexterm>directory if it's empty <indexterm><primary>empty</primary></indexterm>otherwise it will exit <indexterm><primary>exit</primary></indexterm>with an error <indexterm><primary>error</primary></indexterm>message.</para></listitem></varlistentry><varlistentry><term>mv ]]></screen><para>This will only remove <indexterm><primary>remove</primary></indexterm>directory if it's empty <indexterm><primary>empty</primary></indexterm>otherwise it will exit <indexterm><primary>exit</primary></indexterm>with an error <indexterm><primary>error</primary></indexterm>message.</para></listitem></varlistentry><varlistentry><term>mv
</term><listitem><para><indexterm><primary>mv</primary></indexterm>Move a file or a directory to a new <indexterm><primary>new</primary></indexterm>location or rename <indexterm><primary>rename</primary></indexterm>a file/directory.</para><para>Rename <indexterm><primary>Rename</primary></indexterm>example: </para><screen><![CDATA[mv filename1 filename2 </term><listitem><para><indexterm><primary>mv</primary></indexterm>Move a file or a directory to a new <indexterm><primary>new</primary></indexterm>location or rename <indexterm><primary>rename</primary></indexterm>a file/directory.</para><para>Rename <indexterm><primary>Rename</primary></indexterm>example: </para><screen><![CDATA[mv filename1 filename2
@ -807,7 +806,7 @@ Note that you can also move and rename a file in a single command. The differenc
<screen><![CDATA[mv /etc/configuration.txt /home/joe/backupconfig]]></screen> <screen><![CDATA[mv /etc/configuration.txt /home/joe/backupconfig]]></screen>
<para>This would move the file &quot;configuration.txt&quot; to /home/joe/ and rename it &quot;backupconfig&quot;</para> <para>This would move the file &quot;configuration.txt&quot; to /home/joe/ and rename it &quot;backupconfig&quot;</para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>cp </listitem></varlistentry><varlistentry><term>cp
</term><listitem><para><indexterm><primary>cp</primary></indexterm>Copy a file. Has a number <indexterm><primary>number</primary></indexterm>of useful options, such as<emphasis> -R <indexterm><primary>-R</primary></indexterm></emphasis>(or <emphasis>-r</emphasis>) which <indexterm><primary>which</primary></indexterm>recursively <indexterm><primary>recursively</primary></indexterm>copies <indexterm><primary>copies</primary></indexterm>directories and subdirectories.<indexterm><primary>subdirectories</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[cp -options file_or_files new_location </term><listitem><para><indexterm><primary>cp</primary></indexterm>Copy a file. Has a number <indexterm><primary>number</primary></indexterm>of useful options, such as<emphasis> -R <indexterm><primary>-R</primary></indexterm></emphasis>(or <emphasis>-r</emphasis>) which <indexterm><primary>which</primary></indexterm>recursively <indexterm><primary>recursively</primary></indexterm>copies <indexterm><primary>copies</primary></indexterm>directories and subdirectories.<indexterm><primary>subdirectories</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[cp -options file_or_files new_location
]]></screen><para>Examples:</para><screen><![CDATA[cp file1 file2 ]]></screen><para>Examples:</para><screen><![CDATA[cp file1 file2
]]></screen><para>Simply copy file1 <indexterm><primary>file1</primary></indexterm>to file2 <indexterm><primary>file2</primary></indexterm>(in the same directory).</para><screen><![CDATA[cp /tmp/file1 ~/file2 /mnt/win_c ]]></screen><para>Simply copy file1 <indexterm><primary>file1</primary></indexterm>to file2 <indexterm><primary>file2</primary></indexterm>(in the same directory).</para><screen><![CDATA[cp /tmp/file1 ~/file2 /mnt/win_c
@ -849,7 +848,7 @@ Please note that as mentioned in the shred manual page (please see the manual an
The command <emphasis>dd</emphasis> is used to work on a very low level. It can be used to overwrite important information such as your master-boot record or various important sections of your hard-disk. Please be careful when using it (especially when working with devices instead of files). The command <emphasis>dd</emphasis> is used to work on a very low level. It can be used to overwrite important information such as your master-boot record or various important sections of your hard-disk. Please be careful when using it (especially when working with devices instead of files).
</para> </para>
</warning> </warning>
</listitem></listitem></varlistentry><varlistentry><term>touch </listitem></varlistentry><varlistentry><term>touch
</term><listitem><para><indexterm><primary>touch</primary></indexterm>This command is used to create empty <indexterm><primary>empty</primary></indexterm>files, simply do<emphasis> touch file_name</emphasis>. It is also used to update <indexterm><primary>update</primary></indexterm>the timestamps <indexterm><primary>timestamps</primary></indexterm>on files.</para><para><emphasis>touch</emphasis> can be used to change <indexterm><primary>change</primary></indexterm>the time and/or date of a file:</para><screen><![CDATA[touch -t]]><indexterm><primary>-t</primary></indexterm><![CDATA[ 05070915 my_report.txt]]><footnote><para>This particular command and explanation has been used (with editing) from the <productname>Linux</productname> Online Classroom, see [4] in the <xref linkend="references"> for further information.</para></footnote><![CDATA[ </term><listitem><para><indexterm><primary>touch</primary></indexterm>This command is used to create empty <indexterm><primary>empty</primary></indexterm>files, simply do<emphasis> touch file_name</emphasis>. It is also used to update <indexterm><primary>update</primary></indexterm>the timestamps <indexterm><primary>timestamps</primary></indexterm>on files.</para><para><emphasis>touch</emphasis> can be used to change <indexterm><primary>change</primary></indexterm>the time and/or date of a file:</para><screen><![CDATA[touch -t]]><indexterm><primary>-t</primary></indexterm><![CDATA[ 05070915 my_report.txt]]><footnote><para>This particular command and explanation has been used (with editing) from the <productname>Linux</productname> Online Classroom, see [4] in the <xref linkend="references"> for further information.</para></footnote><![CDATA[
]]></screen><para>This command would change <indexterm><primary>change</primary></indexterm>the timestamp <indexterm><primary>timestamp</primary></indexterm>on my_report.txt so that it would look <indexterm><primary>look</primary></indexterm>like you created it at 9:15. The first four digits <indexterm><primary>digits</primary></indexterm>stand for May 7th (0507), in MM-DD (American style), and the last <indexterm><primary>last</primary></indexterm>four (0915) the time,<indexterm><primary>time</primary></indexterm> 9:15 in the morning.<indexterm><primary>morning</primary></indexterm> </para><para>Instead of using plain <indexterm><primary>plain</primary></indexterm>numbers to change <indexterm><primary>change</primary></indexterm>the time, you can use options similar to that of the <emphasis>date</emphasis> tool. For example:</para><screen><![CDATA[touch -d '5 May 2000' some_file.txt ]]></screen><para>This command would change <indexterm><primary>change</primary></indexterm>the timestamp <indexterm><primary>timestamp</primary></indexterm>on my_report.txt so that it would look <indexterm><primary>look</primary></indexterm>like you created it at 9:15. The first four digits <indexterm><primary>digits</primary></indexterm>stand for May 7th (0507), in MM-DD (American style), and the last <indexterm><primary>last</primary></indexterm>four (0915) the time,<indexterm><primary>time</primary></indexterm> 9:15 in the morning.<indexterm><primary>morning</primary></indexterm> </para><para>Instead of using plain <indexterm><primary>plain</primary></indexterm>numbers to change <indexterm><primary>change</primary></indexterm>the time, you can use options similar to that of the <emphasis>date</emphasis> tool. For example:</para><screen><![CDATA[touch -d '5 May 2000' some_file.txt
]]></screen><para>You can also use <emphasis>--date=</emphasis> instead of <emphasis>-d<indexterm><primary>-d</primary></indexterm><indexterm><primary>--date=</primary></indexterm>. </emphasis>Also have a look at the date command under <xref linkend="date-time-calendars"> for examples <indexterm><primary>examples</primary></indexterm>on using <emphasis>-d</emphasis> and <emphasis>--date=</emphasis> (the syntax <indexterm><primary>syntax</primary></indexterm>for the date <indexterm><primary>date</primary></indexterm>part is exactly <indexterm><primary>exactly</primary></indexterm>the same when using <emphasis>-d</emphasis> or <emphasis>--date</emphasis>).</para></listitem></varlistentry><varlistentry><term>split ]]></screen><para>You can also use <emphasis>--date=</emphasis> instead of <emphasis>-d<indexterm><primary>-d</primary></indexterm><indexterm><primary>--date=</primary></indexterm>. </emphasis>Also have a look at the date command under <xref linkend="date-time-calendars"> for examples <indexterm><primary>examples</primary></indexterm>on using <emphasis>-d</emphasis> and <emphasis>--date=</emphasis> (the syntax <indexterm><primary>syntax</primary></indexterm>for the date <indexterm><primary>date</primary></indexterm>part is exactly <indexterm><primary>exactly</primary></indexterm>the same when using <emphasis>-d</emphasis> or <emphasis>--date</emphasis>).</para></listitem></varlistentry><varlistentry><term>split
@ -867,13 +866,13 @@ The command <emphasis>dd</emphasis> is used to work on a very low level. It can
<title>Tip:</title> <title>Tip:</title>
<para>A <application>Java</application> alternative to <emphasis>mmv</emphasis> which runs on both GNU/Linux and <productname>Windows</productname> is available, <ulink url="http://www.esomaniac.de/">Esomaniac</ulink></para> <para>A <application>Java</application> alternative to <emphasis>mmv</emphasis> which runs on both GNU/Linux and <productname>Windows</productname> is available, <ulink url="http://www.esomaniac.de/">Esomaniac</ulink></para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>rename </listitem></varlistentry><varlistentry><term>rename
</term><listitem><para><indexterm><primary>rename</primary></indexterm><emphasis>rename</emphasis> is a perl <indexterm><primary>perl</primary></indexterm>script which <indexterm><primary>which</primary></indexterm>can be used to mass rename <indexterm><primary>mass rename</primary></indexterm>files according to a regular expression<indexterm><primary>regular expression</primary></indexterm>.</para><para>An example for renaming <indexterm><primary>renaming</primary></indexterm>all &ldquo;.JPG&rdquo; files to &ldquo;.jpg&rdquo; is:</para><screen><![CDATA[rename 's/\.JPG$/.jpg/' *.JPG </term><listitem><para><indexterm><primary>rename</primary></indexterm><emphasis>rename</emphasis> is a perl <indexterm><primary>perl</primary></indexterm>script which <indexterm><primary>which</primary></indexterm>can be used to mass rename <indexterm><primary>mass rename</primary></indexterm>files according to a regular expression<indexterm><primary>regular expression</primary></indexterm>.</para><para>An example for renaming <indexterm><primary>renaming</primary></indexterm>all &ldquo;.JPG&rdquo; files to &ldquo;.jpg&rdquo; is:</para><screen><![CDATA[rename 's/\.JPG$/.jpg/' *.JPG
]]></screen><note> ]]></screen><note>
<title>Finding rename</title> <title>Finding rename</title>
<para>You can get rename from various places. I would recommend trying <ulink url="http://search.cpan.org">CPAN Search Site</ulink>, I found the script here <ulink url="http://search.cpan.org/~pederst/rename-1.4/">Rename Script Version 1.4</ulink></para> <para>You can get rename from various places. I would recommend trying <ulink url="http://search.cpan.org">CPAN Search Site</ulink>, I found the script here <ulink url="http://search.cpan.org/~pederst/rename-1.4/">Rename Script Version 1.4</ulink></para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>Bash&nbsp;scripting </listitem></varlistentry><varlistentry><term>Bash&nbsp;scripting
</term><listitem><para><indexterm><primary>scripting</primary></indexterm>Bash <indexterm><primary>Bash</primary></indexterm>scripting is one way to rename <indexterm><primary>rename</primary></indexterm>files. You can develop <indexterm><primary>develop</primary></indexterm>a set <indexterm><primary>set</primary></indexterm>of instructions <indexterm><primary>instructions</primary></indexterm>(a script) to rename <indexterm><primary>rename</primary></indexterm>files. Scripts <indexterm><primary>Scripts</primary></indexterm>are useful if you don't have <emphasis>mmv</emphasis> or <emphasis>rename</emphasis>...</para><para>One way to this is shown <indexterm><primary>shown</primary></indexterm>below:</para><screen><![CDATA[for i in *.JPG; </term><listitem><para><indexterm><primary>scripting</primary></indexterm>Bash <indexterm><primary>Bash</primary></indexterm>scripting is one way to rename <indexterm><primary>rename</primary></indexterm>files. You can develop <indexterm><primary>develop</primary></indexterm>a set <indexterm><primary>set</primary></indexterm>of instructions <indexterm><primary>instructions</primary></indexterm>(a script) to rename <indexterm><primary>rename</primary></indexterm>files. Scripts <indexterm><primary>Scripts</primary></indexterm>are useful if you don't have <emphasis>mmv</emphasis> or <emphasis>rename</emphasis>...</para><para>One way to this is shown <indexterm><primary>shown</primary></indexterm>below:</para><screen><![CDATA[for i in *.JPG;
]]><![CDATA[do mv $i `basename $i JPG`jpg; ]]><![CDATA[do mv $i `basename $i JPG`jpg;
]]><![CDATA[done ]]><![CDATA[done
@ -911,8 +910,8 @@ The command <emphasis>dd</emphasis> is used to work on a very low level. It can
<para>The <emphasis>w</emphasis> command displays the output <indexterm><primary>output</primary></indexterm>of the uptime command when you run this command. You could use the <emphasis>w</emphasis> command instead of uptime. <para>The <emphasis>w</emphasis> command displays the output <indexterm><primary>output</primary></indexterm>of the uptime command when you run this command. You could use the <emphasis>w</emphasis> command instead of uptime.
</para> </para>
</tip> </tip>
</listitem></varlistentry><varlistentry><term>uname<emphasis> </listitem></varlistentry><varlistentry><term><emphasis>uname</emphasis>
</term><listitem><para>uname<indexterm><primary>uname</primary></indexterm></emphasis> is used to print information <indexterm><primary>information</primary></indexterm>on the system such as OS <indexterm><primary>OS</primary></indexterm>type, kernel version<indexterm><primary>kernel version</primary></indexterm> et cetera.</para><para>Some <emphasis>uname</emphasis> options:</para><itemizedlist><listitem><para><emphasis>-a<indexterm><primary>-a</primary></indexterm></emphasis> --- print all the available <indexterm><primary>available</primary></indexterm>information.</para></listitem><listitem><para><emphasis>-m<indexterm><primary>-m</primary></indexterm></emphasis> --- print only information related to the machine <indexterm><primary>machine</primary></indexterm>itself. </para></listitem><listitem><para><emphasis>-n<indexterm><primary>-n</primary></indexterm></emphasis> --- print only the machine hostname. </para></listitem><listitem><para><emphasis>-r<indexterm><primary>-r</primary></indexterm></emphasis> --- print the release number<indexterm><primary>release number</primary></indexterm> of the current <indexterm><primary>current</primary></indexterm>kernel.<indexterm><primary>kernel</primary></indexterm> </para></listitem><listitem><para><emphasis>-s<indexterm><primary>-s</primary></indexterm></emphasis> --- print the operating <indexterm><primary>operating</primary></indexterm>system name </para></listitem><listitem><para><emphasis>-p<indexterm><primary>-p</primary></indexterm></emphasis> --- print the processor <indexterm><primary>processor</primary></indexterm>type. </para></listitem></itemizedlist><para>Command syntax:</para><screen><![CDATA[uname -options </term><listitem><para><emphasis>uname<indexterm><primary>uname</primary></indexterm></emphasis> is used to print information <indexterm><primary>information</primary></indexterm>on the system such as OS <indexterm><primary>OS</primary></indexterm>type, kernel version<indexterm><primary>kernel version</primary></indexterm> et cetera.</para><para>Some <emphasis>uname</emphasis> options:</para><itemizedlist><listitem><para><emphasis>-a<indexterm><primary>-a</primary></indexterm></emphasis> --- print all the available <indexterm><primary>available</primary></indexterm>information.</para></listitem><listitem><para><emphasis>-m<indexterm><primary>-m</primary></indexterm></emphasis> --- print only information related to the machine <indexterm><primary>machine</primary></indexterm>itself. </para></listitem><listitem><para><emphasis>-n<indexterm><primary>-n</primary></indexterm></emphasis> --- print only the machine hostname. </para></listitem><listitem><para><emphasis>-r<indexterm><primary>-r</primary></indexterm></emphasis> --- print the release number<indexterm><primary>release number</primary></indexterm> of the current <indexterm><primary>current</primary></indexterm>kernel.<indexterm><primary>kernel</primary></indexterm> </para></listitem><listitem><para><emphasis>-s<indexterm><primary>-s</primary></indexterm></emphasis> --- print the operating <indexterm><primary>operating</primary></indexterm>system name </para></listitem><listitem><para><emphasis>-p<indexterm><primary>-p</primary></indexterm></emphasis> --- print the processor <indexterm><primary>processor</primary></indexterm>type. </para></listitem></itemizedlist><para>Command syntax:</para><screen><![CDATA[uname -options
]]></screen></listitem></varlistentry><varlistentry><term>xargs ]]></screen></listitem></varlistentry><varlistentry><term>xargs
</term><listitem><para><indexterm><primary>xargs</primary></indexterm>Note that <emphasis>xargs</emphasis> is an advanced,<indexterm><primary>advanced</primary></indexterm> confusing,<indexterm><primary>confusing</primary></indexterm> yet powerful <indexterm><primary>powerful</primary></indexterm>command. <emphasis>xargs</emphasis> is a command used to run other commands as many times <indexterm><primary>times</primary></indexterm>as necessary, this way it prevents any kind of overload... When you run a command then add a<emphasis> &ldquo;| xargs <indexterm><primary>xargs</primary></indexterm>command2<indexterm><primary>command2</primary></indexterm></emphasis>&rdquo;. The results <indexterm><primary>results</primary></indexterm>of command1 <indexterm><primary>command1</primary></indexterm>will be passed <indexterm><primary>passed</primary></indexterm>to command2, possibly on a line-by-line basis or something similar.<indexterm><primary>command2</primary></indexterm> </para><para>Understanding <emphasis>xargs</emphasis> tends <indexterm><primary>tends</primary></indexterm>to be very difficult and my explanation <indexterm><primary>explanation</primary></indexterm>is not the best. Refer <indexterm><primary>Refer</primary></indexterm>to the examples <indexterm><primary>examples</primary></indexterm>below or try [6] of the <xref linkend="references"> for another <emphasis>xargs</emphasis> tutorial.<indexterm><primary>tutorial</primary></indexterm></para><note> </term><listitem><para><indexterm><primary>xargs</primary></indexterm>Note that <emphasis>xargs</emphasis> is an advanced,<indexterm><primary>advanced</primary></indexterm> confusing,<indexterm><primary>confusing</primary></indexterm> yet powerful <indexterm><primary>powerful</primary></indexterm>command. <emphasis>xargs</emphasis> is a command used to run other commands as many times <indexterm><primary>times</primary></indexterm>as necessary, this way it prevents any kind of overload... When you run a command then add a<emphasis> &ldquo;| xargs <indexterm><primary>xargs</primary></indexterm>command2<indexterm><primary>command2</primary></indexterm></emphasis>&rdquo;. The results <indexterm><primary>results</primary></indexterm>of command1 <indexterm><primary>command1</primary></indexterm>will be passed <indexterm><primary>passed</primary></indexterm>to command2, possibly on a line-by-line basis or something similar.<indexterm><primary>command2</primary></indexterm> </para><para>Understanding <emphasis>xargs</emphasis> tends <indexterm><primary>tends</primary></indexterm>to be very difficult and my explanation <indexterm><primary>explanation</primary></indexterm>is not the best. Refer <indexterm><primary>Refer</primary></indexterm>to the examples <indexterm><primary>examples</primary></indexterm>below or try [6] of the <xref linkend="references"> for another <emphasis>xargs</emphasis> tutorial.<indexterm><primary>tutorial</primary></indexterm></para><note>
<title>Alternatives to using xargs</title> <title>Alternatives to using xargs</title>
@ -942,8 +941,8 @@ The command <emphasis>dd</emphasis> is used to work on a very low level. It can
</note> </note>
</listitem></varlistentry></variablelist></sect1> </listitem></varlistentry></variablelist></sect1>
</chapter> </chapter>
<chapter id="Controlling-the-system"><title>Controlling the system</title><para>The controlling <indexterm><primary>controlling</primary></indexterm>the system chapter details <indexterm><primary>details</primary></indexterm>commands that you may wish to use to interact <indexterm><primary>interact</primary></indexterm>with devices <indexterm><primary>devices</primary></indexterm>on your system and then details how to control<indexterm><primary>control</primary></indexterm> processes <indexterm><primary>processes</primary></indexterm>and services/daemons.</para><variablelist><varlistentry><term>eject<emphasis> <chapter id="Controlling-the-system"><title>Controlling the system</title><para>The controlling <indexterm><primary>controlling</primary></indexterm>the system chapter details <indexterm><primary>details</primary></indexterm>commands that you may wish to use to interact <indexterm><primary>interact</primary></indexterm>with devices <indexterm><primary>devices</primary></indexterm>on your system and then details how to control<indexterm><primary>control</primary></indexterm> processes <indexterm><primary>processes</primary></indexterm>and services/daemons.</para><variablelist><varlistentry><term><emphasis>eject</emphasis>
</term><listitem><para>eject<indexterm><primary>eject</primary></indexterm></emphasis> simply tells <indexterm><primary>tells</primary></indexterm>a device <indexterm><primary>device</primary></indexterm>to open <indexterm><primary>open</primary></indexterm>(eject) the drive. Useful for cdrom/DVD drives.<indexterm><primary>drives</primary></indexterm></para><para>For example the command below would eject the cdrom-drive <indexterm><primary>cdrom-drive</primary></indexterm>(if your cdrom<indexterm><primary>cdrom</primary></indexterm> is linked <indexterm><primary>linked</primary></indexterm>to /dev/cdrom):</para><screen><![CDATA[eject /dev/cdrom </term><listitem><para><emphasis>eject<indexterm><primary>eject</primary></indexterm></emphasis> simply tells <indexterm><primary>tells</primary></indexterm>a device <indexterm><primary>device</primary></indexterm>to open <indexterm><primary>open</primary></indexterm>(eject) the drive. Useful for cdrom/DVD drives.<indexterm><primary>drives</primary></indexterm></para><para>For example the command below would eject the cdrom-drive <indexterm><primary>cdrom-drive</primary></indexterm>(if your cdrom<indexterm><primary>cdrom</primary></indexterm> is linked <indexterm><primary>linked</primary></indexterm>to /dev/cdrom):</para><screen><![CDATA[eject /dev/cdrom
]]></screen><note> ]]></screen><note>
<title>This won't work unless</title> <title>This won't work unless</title>
<para> <para>
@ -1030,7 +1029,7 @@ On any system running a newer version of the <productname>Linux</productname> ke
<title>Shutdown -h vs poweroff</title> <title>Shutdown -h vs poweroff</title>
<para>On some systems, <emphasis>shutdown -h </emphasis>and <emphasis>halt </emphasis>do not actually turn the system's power off. On systems that do not power off with these commands use the <emphasis>poweroff</emphasis><indexterm><primary>poweroff</primary></indexterm> command</para> <para>On some systems, <emphasis>shutdown -h </emphasis>and <emphasis>halt </emphasis>do not actually turn the system's power off. On systems that do not power off with these commands use the <emphasis>poweroff</emphasis><indexterm><primary>poweroff</primary></indexterm> command</para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>halt </listitem></varlistentry><varlistentry><term>halt
</term><listitem><para><indexterm><primary>halt</primary></indexterm>The same as <emphasis>shutdown -h now</emphasis> doesn't take any options,<indexterm><primary>options</primary></indexterm> this command simply shuts down immediately.</para></listitem></varlistentry><varlistentry><term>shutdown&nbsp;-r&nbsp;now </term><listitem><para><indexterm><primary>halt</primary></indexterm>The same as <emphasis>shutdown -h now</emphasis> doesn't take any options,<indexterm><primary>options</primary></indexterm> this command simply shuts down immediately.</para></listitem></varlistentry><varlistentry><term>shutdown&nbsp;-r&nbsp;now
</term><listitem><para><indexterm><primary>shutdown -r</primary></indexterm>Shutdown (<emphasis> -r <indexterm><primary>-r</primary></indexterm>= reboot<indexterm><primary>reboot</primary></indexterm></emphasis>) the computer immediately. It begins the reboot procedure,<indexterm><primary>procedure</primary></indexterm> press <indexterm><primary>press</primary></indexterm> </term><listitem><para><indexterm><primary>shutdown -r</primary></indexterm>Shutdown (<emphasis> -r <indexterm><primary>-r</primary></indexterm>= reboot<indexterm><primary>reboot</primary></indexterm></emphasis>) the computer immediately. It begins the reboot procedure,<indexterm><primary>procedure</primary></indexterm> press <indexterm><primary>press</primary></indexterm>
<keycombo> <keycombo>
@ -1047,7 +1046,7 @@ On any system running a newer version of the <productname>Linux</productname> ke
<screen>shutdown -r 11:50</screen> <screen>shutdown -r 11:50</screen>
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>reboot </listitem></varlistentry><varlistentry><term>reboot
</term><listitem><para>The same as <emphasis>shutdown -r now</emphasis>, doesn't take any options, simply reboots <indexterm><primary>reboots</primary></indexterm>the computer immediately. </para></listitem></varlistentry><varlistentry><term> </term><listitem><para>The same as <emphasis>shutdown -r now</emphasis>, doesn't take any options, simply reboots <indexterm><primary>reboots</primary></indexterm>the computer immediately. </para></listitem></varlistentry><varlistentry><term>
<keycombo> <keycombo>
<keycap>CTRL</keycap> <keycap>CTRL</keycap>
@ -1252,7 +1251,7 @@ You could also change the command it runs for example if you changed the <emphas
<title>Find style in the diction package</title> <title>Find style in the diction package</title>
<para>This command is part of the diction package and does not appear to be used too often these days</para> <para>This command is part of the diction package and does not appear to be used too often these days</para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>cmp </listitem></varlistentry><varlistentry><term>cmp
</term><listitem><para><indexterm><primary>cmp</primary></indexterm>Determines whether or not two files differ, works on any type of file. Very similar to <emphasis>diff</emphasis> only it compares <indexterm><primary>compares</primary></indexterm>on the binary <indexterm><primary>binary</primary></indexterm>level instead of just the text.</para></listitem></varlistentry><varlistentry><term>diff </term><listitem><para><indexterm><primary>cmp</primary></indexterm>Determines whether or not two files differ, works on any type of file. Very similar to <emphasis>diff</emphasis> only it compares <indexterm><primary>compares</primary></indexterm>on the binary <indexterm><primary>binary</primary></indexterm>level instead of just the text.</para></listitem></varlistentry><varlistentry><term>diff
</term><listitem><para><indexterm><primary>diff</primary></indexterm>Compares two text files and output a difference <indexterm><primary>difference</primary></indexterm>report (sometimes called a &quot;diff&quot;<indexterm><primary>diff</primary></indexterm>) containing the text that differs between two files. </para><para>Can be used to create a 'patch' file (which can be used by <emphasis>patch</emphasis>). </para><para>Example:</para><screen><![CDATA[diff file1.txt file2.txt </term><listitem><para><indexterm><primary>diff</primary></indexterm>Compares two text files and output a difference <indexterm><primary>difference</primary></indexterm>report (sometimes called a &quot;diff&quot;<indexterm><primary>diff</primary></indexterm>) containing the text that differs between two files. </para><para>Can be used to create a 'patch' file (which can be used by <emphasis>patch</emphasis>). </para><para>Example:</para><screen><![CDATA[diff file1.txt file2.txt
]]></screen><para><emphasis>diff</emphasis> will output <indexterm><primary>output</primary></indexterm>a '&gt;' (followed by the line) for each line <indexterm><primary>line</primary></indexterm>that isn't in the first file but is in the second file, and it will output a '&lt;' (followed by the line) for each line that is in the first file but not in the second file.</para></listitem></varlistentry><varlistentry><term>sdiff ]]></screen><para><emphasis>diff</emphasis> will output <indexterm><primary>output</primary></indexterm>a '&gt;' (followed by the line) for each line <indexterm><primary>line</primary></indexterm>that isn't in the first file but is in the second file, and it will output a '&lt;' (followed by the line) for each line that is in the first file but not in the second file.</para></listitem></varlistentry><varlistentry><term>sdiff
@ -1294,7 +1293,7 @@ You could also change the command it runs for example if you changed the <emphas
<title>This command is very simple to understand if you make yourself an example</title> <title>This command is very simple to understand if you make yourself an example</title>
<para>Its much easier if you create an example for yourself. With just a couple of lines, I used "first line first file" and "first line second file" et cetera for a quick example.</para> <para>Its much easier if you create an example for yourself. With just a couple of lines, I used "first line first file" and "first line second file" et cetera for a quick example.</para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>expand </listitem></varlistentry><varlistentry><term>expand
</term><listitem><para><indexterm><primary>expand</primary></indexterm>Will convert tabs to spaces <indexterm><primary>spaces</primary></indexterm>and output it. Use the option<emphasis> -t <indexterm><primary>-t</primary></indexterm>num</emphasis> to specify <indexterm><primary>specify</primary></indexterm>the size <indexterm><primary>size</primary></indexterm>of a &ldquo;tapstop&rdquo;, the number of characters <indexterm><primary>characters</primary></indexterm>between each tab.<indexterm><primary>tab</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[expand file_name.txt </term><listitem><para><indexterm><primary>expand</primary></indexterm>Will convert tabs to spaces <indexterm><primary>spaces</primary></indexterm>and output it. Use the option<emphasis> -t <indexterm><primary>-t</primary></indexterm>num</emphasis> to specify <indexterm><primary>specify</primary></indexterm>the size <indexterm><primary>size</primary></indexterm>of a &ldquo;tapstop&rdquo;, the number of characters <indexterm><primary>characters</primary></indexterm>between each tab.<indexterm><primary>tab</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[expand file_name.txt
]]></screen></listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>unexpand ]]></screen></listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>unexpand
</term><listitem><para><indexterm><primary>unexpand</primary></indexterm>Will convert spaces to tabs <indexterm><primary>tabs</primary></indexterm>and output it.</para><para>Command syntax:</para><screen><![CDATA[unexpand file_name.txt </term><listitem><para><indexterm><primary>unexpand</primary></indexterm>Will convert spaces to tabs <indexterm><primary>tabs</primary></indexterm>and output it.</para><para>Command syntax:</para><screen><![CDATA[unexpand file_name.txt
@ -1309,7 +1308,7 @@ You could also change the command it runs for example if you changed the <emphas
You can also do a search and replace with a one line <application>Perl</application> command, read about it at the end of this section. You can also do a search and replace with a one line <application>Perl</application> command, read about it at the end of this section.
</para> </para>
</tip> </tip>
</listitem></listitem></varlistentry><varlistentry><term>nl </listitem></varlistentry><varlistentry><term>nl
</term><listitem><para><indexterm><primary>nl</primary></indexterm>The number lines <indexterm><primary>number lines</primary></indexterm>tool, it's default <indexterm><primary>default</primary></indexterm>action is to write <indexterm><primary>write</primary></indexterm>it's input (either the file names given as an argument,<indexterm><primary>argument</primary></indexterm> or the standard <indexterm><primary>standard</primary></indexterm>input) to the standard output. </para><para>Line <indexterm><primary>Line</primary></indexterm>numbers are added to every line and the text is indented.<indexterm><primary>indented</primary></indexterm> </para><para>This command can do take some more <indexterm><primary>more</primary></indexterm>advanced <indexterm><primary>advanced</primary></indexterm>numbering <indexterm><primary>numbering</primary></indexterm>options, simply read the info <indexterm><primary>info</primary></indexterm>page <indexterm><primary>page</primary></indexterm>on it. </para><para>These advanced <indexterm><primary>advanced</primary></indexterm>options mainly relate to customisation <indexterm><primary>customisation</primary></indexterm>of the numbering,<indexterm><primary>numbering</primary></indexterm> including <indexterm><primary>including</primary></indexterm>different forms <indexterm><primary>forms</primary></indexterm>of separation <indexterm><primary>separation</primary></indexterm>for sections/pages/footers etc.</para><para>Also try <emphasis> cat -n<indexterm><primary>cat</primary></indexterm><indexterm><primary>-n</primary></indexterm></emphasis> (number all lines) or<emphasis> cat -b<indexterm><primary>-b</primary></indexterm></emphasis> (number all non-blank <indexterm><primary>non-blank</primary></indexterm>lines). For more <indexterm><primary>more</primary></indexterm>info <indexterm><primary>info</primary></indexterm>on <emphasis>cat</emphasis> check <indexterm><primary>check</primary></indexterm>under this section:<indexterm><primary>section</primary></indexterm> <xref linkend="text-viewing-tools"> </para><para>There are two ways you can use <emphasis>nl</emphasis>:</para><screen><![CDATA[nl some_text_file.txt </term><listitem><para><indexterm><primary>nl</primary></indexterm>The number lines <indexterm><primary>number lines</primary></indexterm>tool, it's default <indexterm><primary>default</primary></indexterm>action is to write <indexterm><primary>write</primary></indexterm>it's input (either the file names given as an argument,<indexterm><primary>argument</primary></indexterm> or the standard <indexterm><primary>standard</primary></indexterm>input) to the standard output. </para><para>Line <indexterm><primary>Line</primary></indexterm>numbers are added to every line and the text is indented.<indexterm><primary>indented</primary></indexterm> </para><para>This command can do take some more <indexterm><primary>more</primary></indexterm>advanced <indexterm><primary>advanced</primary></indexterm>numbering <indexterm><primary>numbering</primary></indexterm>options, simply read the info <indexterm><primary>info</primary></indexterm>page <indexterm><primary>page</primary></indexterm>on it. </para><para>These advanced <indexterm><primary>advanced</primary></indexterm>options mainly relate to customisation <indexterm><primary>customisation</primary></indexterm>of the numbering,<indexterm><primary>numbering</primary></indexterm> including <indexterm><primary>including</primary></indexterm>different forms <indexterm><primary>forms</primary></indexterm>of separation <indexterm><primary>separation</primary></indexterm>for sections/pages/footers etc.</para><para>Also try <emphasis> cat -n<indexterm><primary>cat</primary></indexterm><indexterm><primary>-n</primary></indexterm></emphasis> (number all lines) or<emphasis> cat -b<indexterm><primary>-b</primary></indexterm></emphasis> (number all non-blank <indexterm><primary>non-blank</primary></indexterm>lines). For more <indexterm><primary>more</primary></indexterm>info <indexterm><primary>info</primary></indexterm>on <emphasis>cat</emphasis> check <indexterm><primary>check</primary></indexterm>under this section:<indexterm><primary>section</primary></indexterm> <xref linkend="text-viewing-tools"> </para><para>There are two ways you can use <emphasis>nl</emphasis>:</para><screen><![CDATA[nl some_text_file.txt
]]></screen><para>The above command would add <indexterm><primary>add</primary></indexterm>numbers to each line of some_text_file.<indexterm><primary>some_text_file</primary></indexterm> You could use <emphasis>nl</emphasis> to number the output of something as shown <indexterm><primary>shown</primary></indexterm>in the example below;</para><screen><![CDATA[grep some_string some_file | nl ]]></screen><para>The above command would add <indexterm><primary>add</primary></indexterm>numbers to each line of some_text_file.<indexterm><primary>some_text_file</primary></indexterm> You could use <emphasis>nl</emphasis> to number the output of something as shown <indexterm><primary>shown</primary></indexterm>in the example below;</para><screen><![CDATA[grep some_string some_file | nl
]]></screen></listitem></varlistentry><varlistentry><term>Perl&nbsp;search&nbsp;and&nbsp;replace&nbsp;text ]]></screen></listitem></varlistentry><varlistentry><term>Perl&nbsp;search&nbsp;and&nbsp;replace&nbsp;text
@ -1392,7 +1391,7 @@ The &ldquo;num-utils&rdquo; homepage, <ulink url="http://suso.suso.org/programs/
</indexterm> </indexterm>
(end-of-file key) when you are finished <indexterm><primary>finished</primary></indexterm>using <emphasis>units</emphasis>.</para> (end-of-file key) when you are finished <indexterm><primary>finished</primary></indexterm>using <emphasis>units</emphasis>.</para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>python </listitem></varlistentry><varlistentry><term>python
</term><listitem><para><indexterm><primary>python</primary></indexterm>Python <indexterm><primary>Python</primary></indexterm>is a very powerful,<indexterm><primary>powerful</primary></indexterm> easy to learn,<indexterm><primary>learn</primary></indexterm> general <indexterm><primary>general</primary></indexterm>purpose, interpreted<indexterm><primary>interpreted</primary></indexterm> programming <indexterm><primary>programming</primary></indexterm>language. And it makes a great <indexterm><primary>great</primary></indexterm>calculator! If you don't have a calculator <indexterm><primary>calculator</primary></indexterm>installed<indexterm><primary>installed</primary></indexterm> then simply type <emphasis>python</emphasis>, then hit <indexterm><primary>hit</primary></indexterm>[Enter]. </para><para>This will execute <indexterm><primary>execute</primary></indexterm>the <acronym>Python</acronym> <indexterm><primary>Python</primary></indexterm>interpreter in interactive <indexterm><primary>interactive</primary></indexterm>mode. Type your sums <indexterm><primary>sums</primary></indexterm>just like you would use a calculator.<indexterm><primary>calculator</primary></indexterm> Note that if you want to work out fractions <indexterm><primary>fractions</primary></indexterm>make sure you use a decimal<indexterm><primary>decimal</primary></indexterm> point and a zero <indexterm><primary>zero</primary></indexterm>to obtain the correct <indexterm><primary>correct</primary></indexterm>answer (otherwise it will use integer<indexterm><primary>integer</primary></indexterm> division).</para><para>To start <indexterm><primary>start</primary></indexterm>python in interactive <indexterm><primary>interactive</primary></indexterm>mode, simply type:</para><screen><![CDATA[python </term><listitem><para><indexterm><primary>python</primary></indexterm>Python <indexterm><primary>Python</primary></indexterm>is a very powerful,<indexterm><primary>powerful</primary></indexterm> easy to learn,<indexterm><primary>learn</primary></indexterm> general <indexterm><primary>general</primary></indexterm>purpose, interpreted<indexterm><primary>interpreted</primary></indexterm> programming <indexterm><primary>programming</primary></indexterm>language. And it makes a great <indexterm><primary>great</primary></indexterm>calculator! If you don't have a calculator <indexterm><primary>calculator</primary></indexterm>installed<indexterm><primary>installed</primary></indexterm> then simply type <emphasis>python</emphasis>, then hit <indexterm><primary>hit</primary></indexterm>[Enter]. </para><para>This will execute <indexterm><primary>execute</primary></indexterm>the <acronym>Python</acronym> <indexterm><primary>Python</primary></indexterm>interpreter in interactive <indexterm><primary>interactive</primary></indexterm>mode. Type your sums <indexterm><primary>sums</primary></indexterm>just like you would use a calculator.<indexterm><primary>calculator</primary></indexterm> Note that if you want to work out fractions <indexterm><primary>fractions</primary></indexterm>make sure you use a decimal<indexterm><primary>decimal</primary></indexterm> point and a zero <indexterm><primary>zero</primary></indexterm>to obtain the correct <indexterm><primary>correct</primary></indexterm>answer (otherwise it will use integer<indexterm><primary>integer</primary></indexterm> division).</para><para>To start <indexterm><primary>start</primary></indexterm>python in interactive <indexterm><primary>interactive</primary></indexterm>mode, simply type:</para><screen><![CDATA[python
]]></screen><para>Once python <indexterm><primary>python</primary></indexterm>is started <indexterm><primary>started</primary></indexterm>you can use it to add <indexterm><primary>add</primary></indexterm>up sums <indexterm><primary>sums</primary></indexterm>or maybe do some python programming.<indexterm><primary>programming</primary></indexterm></para><para>Use ]]></screen><para>Once python <indexterm><primary>python</primary></indexterm>is started <indexterm><primary>started</primary></indexterm>you can use it to add <indexterm><primary>add</primary></indexterm>up sums <indexterm><primary>sums</primary></indexterm>or maybe do some python programming.<indexterm><primary>programming</primary></indexterm></para><para>Use
<keycombo> <keycombo>
@ -1411,7 +1410,7 @@ The &ldquo;num-utils&rdquo; homepage, <ulink url="http://suso.suso.org/programs/
Please note that this tool is part of the num-utils package. Please note that this tool is part of the num-utils package.
</para> </para>
</note> </note>
</listitem></listitem></varlistentry></variablelist><para></para></chapter> </listitem></varlistentry></variablelist><para></para></chapter>
<chapter id="Network-commands"><title>Network Commands</title><para>The network <indexterm><primary>network</primary></indexterm>commands chapter explains <indexterm><primary>explains</primary></indexterm>various tools which can be useful when networking <indexterm><primary>networking</primary></indexterm>with other computers <indexterm><primary>computers</primary></indexterm>both within the network <indexterm><primary>network</primary></indexterm>and accross the internet,<indexterm><primary>internet</primary></indexterm> obtaining more <indexterm><primary>more</primary></indexterm>information <indexterm><primary>information</primary></indexterm>about other computers. This chapter also includes <indexterm><primary>includes</primary></indexterm>information on tools for network <indexterm><primary>network</primary></indexterm>configuration, file transfer <indexterm><primary>transfer</primary></indexterm>and working with remote machines.<indexterm><primary>remote machines</primary></indexterm></para><variablelist><varlistentry><term>netstat <chapter id="Network-commands"><title>Network Commands</title><para>The network <indexterm><primary>network</primary></indexterm>commands chapter explains <indexterm><primary>explains</primary></indexterm>various tools which can be useful when networking <indexterm><primary>networking</primary></indexterm>with other computers <indexterm><primary>computers</primary></indexterm>both within the network <indexterm><primary>network</primary></indexterm>and accross the internet,<indexterm><primary>internet</primary></indexterm> obtaining more <indexterm><primary>more</primary></indexterm>information <indexterm><primary>information</primary></indexterm>about other computers. This chapter also includes <indexterm><primary>includes</primary></indexterm>information on tools for network <indexterm><primary>network</primary></indexterm>configuration, file transfer <indexterm><primary>transfer</primary></indexterm>and working with remote machines.<indexterm><primary>remote machines</primary></indexterm></para><variablelist><varlistentry><term>netstat
</term><listitem><para><indexterm><primary>netstat</primary></indexterm>Displays contents <indexterm><primary>contents</primary></indexterm>of /proc/net files.<indexterm><primary>/proc/net</primary></indexterm> It works with the <productname>Linux</productname> Network Subsystem,<indexterm><primary>Subsystem</primary></indexterm> it will tell <indexterm><primary>tell</primary></indexterm>you what the status<indexterm><primary>status</primary></indexterm> of ports <indexterm><primary>ports</primary></indexterm>are ie. open,<indexterm><primary>open</primary></indexterm> closed,<indexterm><primary>closed</primary></indexterm> waiting,<indexterm><primary>waiting</primary></indexterm> masquerade <indexterm><primary>masquerade</primary></indexterm>connections. It will also display various other things. It has many different options.<indexterm><primary>options</primary></indexterm></para></listitem></varlistentry><varlistentry><term>tcpdump </term><listitem><para><indexterm><primary>netstat</primary></indexterm>Displays contents <indexterm><primary>contents</primary></indexterm>of /proc/net files.<indexterm><primary>/proc/net</primary></indexterm> It works with the <productname>Linux</productname> Network Subsystem,<indexterm><primary>Subsystem</primary></indexterm> it will tell <indexterm><primary>tell</primary></indexterm>you what the status<indexterm><primary>status</primary></indexterm> of ports <indexterm><primary>ports</primary></indexterm>are ie. open,<indexterm><primary>open</primary></indexterm> closed,<indexterm><primary>closed</primary></indexterm> waiting,<indexterm><primary>waiting</primary></indexterm> masquerade <indexterm><primary>masquerade</primary></indexterm>connections. It will also display various other things. It has many different options.<indexterm><primary>options</primary></indexterm></para></listitem></varlistentry><varlistentry><term>tcpdump
</term><listitem><para><indexterm><primary>tcpdump</primary></indexterm>This is a sniffer,<indexterm><primary>sniffer</primary></indexterm> a program that captures <indexterm><primary>captures</primary></indexterm>packets off <indexterm><primary>off</primary></indexterm>a network<indexterm><primary>network</primary></indexterm> interface <indexterm><primary>interface</primary></indexterm>and interprets <indexterm><primary>interprets</primary></indexterm>them for you. It understands all basic <indexterm><primary>basic</primary></indexterm>internet <indexterm><primary>Internet</primary></indexterm>protocols,<indexterm><primary>protocols</primary></indexterm> and can be used to save <indexterm><primary>save</primary></indexterm>entire packets <indexterm><primary>packets</primary></indexterm>for later inspection.<indexterm><primary>inspection</primary></indexterm></para></listitem></varlistentry><varlistentry><term>ping </term><listitem><para><indexterm><primary>tcpdump</primary></indexterm>This is a sniffer,<indexterm><primary>sniffer</primary></indexterm> a program that captures <indexterm><primary>captures</primary></indexterm>packets off <indexterm><primary>off</primary></indexterm>a network<indexterm><primary>network</primary></indexterm> interface <indexterm><primary>interface</primary></indexterm>and interprets <indexterm><primary>interprets</primary></indexterm>them for you. It understands all basic <indexterm><primary>basic</primary></indexterm>internet <indexterm><primary>Internet</primary></indexterm>protocols,<indexterm><primary>protocols</primary></indexterm> and can be used to save <indexterm><primary>save</primary></indexterm>entire packets <indexterm><primary>packets</primary></indexterm>for later inspection.<indexterm><primary>inspection</primary></indexterm></para></listitem></varlistentry><varlistentry><term>ping
@ -1432,7 +1431,7 @@ Please note that this tool is part of the num-utils package.
</screen> This line says that their is a computer called &ldquo;new&rdquo;<indexterm><primary>new</primary></indexterm> with IP address 192.168.1.100<indexterm><primary>192.168.1.100</primary></indexterm>. Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name &ldquo;new&rdquo;. </screen> This line says that their is a computer called &ldquo;new&rdquo;<indexterm><primary>new</primary></indexterm> with IP address 192.168.1.100<indexterm><primary>192.168.1.100</primary></indexterm>. Now that it exists in the /etc/hosts file I don't have to type the IP address anymore, just the name &ldquo;new&rdquo;.
</para> </para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>hostname </listitem></varlistentry><varlistentry><term>hostname
</term><listitem><para><indexterm><primary>hostname</primary></indexterm>Tells the user the host <indexterm><primary>host</primary></indexterm>name of the computer they are logged <indexterm><primary>logged</primary></indexterm>into. Note: may be called <emphasis>host.<indexterm><primary>host</primary></indexterm></emphasis></para></listitem></varlistentry><varlistentry><term>traceroute </term><listitem><para><indexterm><primary>hostname</primary></indexterm>Tells the user the host <indexterm><primary>host</primary></indexterm>name of the computer they are logged <indexterm><primary>logged</primary></indexterm>into. Note: may be called <emphasis>host.<indexterm><primary>host</primary></indexterm></emphasis></para></listitem></varlistentry><varlistentry><term>traceroute
</term><listitem><para><indexterm><primary>traceroute</primary></indexterm><emphasis>traceroute</emphasis> will show <indexterm><primary>show</primary></indexterm>the route <indexterm><primary>route</primary></indexterm>of a packet.<indexterm><primary>packet</primary></indexterm> It attempts <indexterm><primary>attempts</primary></indexterm>to list <indexterm><primary>list</primary></indexterm>the series <indexterm><primary>series</primary></indexterm>of hosts <indexterm><primary>hosts</primary></indexterm>through which <indexterm><primary>which</primary></indexterm>your packets <indexterm><primary>packets</primary></indexterm>travel<indexterm><primary>travel</primary></indexterm> on their way to a given destination.<indexterm><primary>destination</primary></indexterm> Also have a look at <emphasis>xtraceroute</emphasis> (one of several <indexterm><primary>several</primary></indexterm>graphical <indexterm><primary>graphical</primary></indexterm>equivalents of this program). </para><para>Command syntax:</para><screen><![CDATA[traceroute machine_name_or_ip </term><listitem><para><indexterm><primary>traceroute</primary></indexterm><emphasis>traceroute</emphasis> will show <indexterm><primary>show</primary></indexterm>the route <indexterm><primary>route</primary></indexterm>of a packet.<indexterm><primary>packet</primary></indexterm> It attempts <indexterm><primary>attempts</primary></indexterm>to list <indexterm><primary>list</primary></indexterm>the series <indexterm><primary>series</primary></indexterm>of hosts <indexterm><primary>hosts</primary></indexterm>through which <indexterm><primary>which</primary></indexterm>your packets <indexterm><primary>packets</primary></indexterm>travel<indexterm><primary>travel</primary></indexterm> on their way to a given destination.<indexterm><primary>destination</primary></indexterm> Also have a look at <emphasis>xtraceroute</emphasis> (one of several <indexterm><primary>several</primary></indexterm>graphical <indexterm><primary>graphical</primary></indexterm>equivalents of this program). </para><para>Command syntax:</para><screen><![CDATA[traceroute machine_name_or_ip
]]></screen></listitem></varlistentry><varlistentry><term>tracepath ]]></screen></listitem></varlistentry><varlistentry><term>tracepath
@ -1469,7 +1468,7 @@ Please note that this tool is part of the num-utils package.
<title>Alternative website downloaders</title> <title>Alternative website downloaders</title>
<para>You may like to try alternatives like httrack<indexterm><primary>httrack</primary></indexterm>. A full <acronym>GUI</acronym> website downloader written in python and available for GNU/Linux </para> <para>You may like to try alternatives like httrack<indexterm><primary>httrack</primary></indexterm>. A full <acronym>GUI</acronym> website downloader written in python and available for GNU/Linux </para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>curl </listitem></varlistentry><varlistentry><term>curl
</term><listitem><para><indexterm><primary>curl</primary></indexterm><emphasis>curl</emphasis> is another remote <indexterm><primary>remote</primary></indexterm>downloader.<indexterm><primary>downloader</primary></indexterm> This remote <indexterm><primary>remote</primary></indexterm>downloader <indexterm><primary>downloader</primary></indexterm>is designed <indexterm><primary>designed</primary></indexterm>to work without user interaction and supports <indexterm><primary>supports</primary></indexterm>a variety <indexterm><primary>variety</primary></indexterm>of protocols,<indexterm><primary>protocols</primary></indexterm> can upload/download and has a large number of tricks/work-arounds for various things. It can access <indexterm><primary>access</primary></indexterm>dictionary <indexterm><primary>dictionary</primary></indexterm>servers <indexterm><primary>servers</primary></indexterm>(dict), ldap <indexterm><primary>ldap</primary></indexterm>servers, ftp, http,<indexterm><primary>http</primary></indexterm> gopher,<indexterm><primary>gopher</primary></indexterm> see the manual <indexterm><primary>manual</primary></indexterm>page for full <indexterm><primary>full</primary></indexterm>details.<indexterm><primary>details</primary></indexterm> </para><para>To access <indexterm><primary>access</primary></indexterm>the full <indexterm><primary>full</primary></indexterm>manual (which is huge) for this command type:</para><screen><![CDATA[curl -M]]><indexterm><primary>-M</primary></indexterm><![CDATA[ </term><listitem><para><indexterm><primary>curl</primary></indexterm><emphasis>curl</emphasis> is another remote <indexterm><primary>remote</primary></indexterm>downloader.<indexterm><primary>downloader</primary></indexterm> This remote <indexterm><primary>remote</primary></indexterm>downloader <indexterm><primary>downloader</primary></indexterm>is designed <indexterm><primary>designed</primary></indexterm>to work without user interaction and supports <indexterm><primary>supports</primary></indexterm>a variety <indexterm><primary>variety</primary></indexterm>of protocols,<indexterm><primary>protocols</primary></indexterm> can upload/download and has a large number of tricks/work-arounds for various things. It can access <indexterm><primary>access</primary></indexterm>dictionary <indexterm><primary>dictionary</primary></indexterm>servers <indexterm><primary>servers</primary></indexterm>(dict), ldap <indexterm><primary>ldap</primary></indexterm>servers, ftp, http,<indexterm><primary>http</primary></indexterm> gopher,<indexterm><primary>gopher</primary></indexterm> see the manual <indexterm><primary>manual</primary></indexterm>page for full <indexterm><primary>full</primary></indexterm>details.<indexterm><primary>details</primary></indexterm> </para><para>To access <indexterm><primary>access</primary></indexterm>the full <indexterm><primary>full</primary></indexterm>manual (which is huge) for this command type:</para><screen><![CDATA[curl -M]]><indexterm><primary>-M</primary></indexterm><![CDATA[
]]></screen><para>For general <indexterm><primary>general</primary></indexterm>usage you can use it like <emphasis>wget</emphasis>. You can also login <indexterm><primary>login</primary></indexterm>using a user name by using the <emphasis>-u<indexterm><primary>-u</primary></indexterm></emphasis> option and typing your username <indexterm><primary>username</primary></indexterm>and password like this:</para><screen><![CDATA[curl -u username:password http://www.placetodownload/file ]]></screen><para>For general <indexterm><primary>general</primary></indexterm>usage you can use it like <emphasis>wget</emphasis>. You can also login <indexterm><primary>login</primary></indexterm>using a user name by using the <emphasis>-u<indexterm><primary>-u</primary></indexterm></emphasis> option and typing your username <indexterm><primary>username</primary></indexterm>and password like this:</para><screen><![CDATA[curl -u username:password http://www.placetodownload/file
]]></screen><para>To upload <indexterm><primary>upload</primary></indexterm>using ftp <indexterm><primary>ftp</primary></indexterm>you the <emphasis>-T<indexterm><primary>-T</primary></indexterm></emphasis> option:<indexterm><primary>option</primary></indexterm></para><screen><![CDATA[curl -T file_name ftp://ftp.uploadsite.com ]]></screen><para>To upload <indexterm><primary>upload</primary></indexterm>using ftp <indexterm><primary>ftp</primary></indexterm>you the <emphasis>-T<indexterm><primary>-T</primary></indexterm></emphasis> option:<indexterm><primary>option</primary></indexterm></para><screen><![CDATA[curl -T file_name ftp://ftp.uploadsite.com
@ -1504,7 +1503,7 @@ Please note that this tool is part of the num-utils package.
This is also a basic security hazard if you have others using your computer and security is a concern, you may like to add a password to your LILO or Grub prompt to stop this from being done. This is also a basic security hazard if you have others using your computer and security is a concern, you may like to add a password to your LILO or Grub prompt to stop this from being done.
</para> </para>
</caution> </caution>
</listitem></listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>umask </listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>umask
</term><listitem><para>The umask <indexterm><primary>umask</primary></indexterm>is a value <indexterm><primary>value</primary></indexterm>set <indexterm><primary>set</primary></indexterm>by the shell.<indexterm><primary>shell</primary></indexterm> It controls <indexterm><primary>controls</primary></indexterm>the default <indexterm><primary>default</primary></indexterm>permissions of any file created during that shell<indexterm><primary>shell</primary></indexterm> session.<indexterm><primary>session</primary></indexterm> This information is inherited from the shell's parent <indexterm><primary>parent</primary></indexterm>and is normally set in some configuration <indexterm><primary>configuration</primary></indexterm>file by the root user (in my case /etc/profile<indexterm><primary>/etc/profile</primary></indexterm>).</para><para>umask has an unusual way of doing things ...to set the umask you must describe<indexterm><primary>describe</primary></indexterm> file permissions <indexterm><primary>file permissions</primary></indexterm>by saying what will be disabled.<indexterm><primary>disabled</primary></indexterm> </para><para>You can do this by doing 777 minus <indexterm><primary>minus</primary></indexterm>the file permissions you want. Note that <emphasis>umask</emphasis> works with numbers <indexterm><primary>numbers</primary></indexterm>only, for an explanation <indexterm><primary>explanation</primary></indexterm> please see, <xref linkend="file-permissions"></para><para>For example:</para><para>You want the default during a particular shell session <indexterm><primary>default</primary></indexterm>to be equivalent <indexterm><primary>equivalent</primary></indexterm>to<emphasis> chmod <indexterm><primary>chmod</primary></indexterm>750</emphasis> (user has r/w/x, group <indexterm><primary>group</primary></indexterm>has r/x and other has no permissions), then the command you would use would be:</para><screen><![CDATA[umask 027 </term><listitem><para>The umask <indexterm><primary>umask</primary></indexterm>is a value <indexterm><primary>value</primary></indexterm>set <indexterm><primary>set</primary></indexterm>by the shell.<indexterm><primary>shell</primary></indexterm> It controls <indexterm><primary>controls</primary></indexterm>the default <indexterm><primary>default</primary></indexterm>permissions of any file created during that shell<indexterm><primary>shell</primary></indexterm> session.<indexterm><primary>session</primary></indexterm> This information is inherited from the shell's parent <indexterm><primary>parent</primary></indexterm>and is normally set in some configuration <indexterm><primary>configuration</primary></indexterm>file by the root user (in my case /etc/profile<indexterm><primary>/etc/profile</primary></indexterm>).</para><para>umask has an unusual way of doing things ...to set the umask you must describe<indexterm><primary>describe</primary></indexterm> file permissions <indexterm><primary>file permissions</primary></indexterm>by saying what will be disabled.<indexterm><primary>disabled</primary></indexterm> </para><para>You can do this by doing 777 minus <indexterm><primary>minus</primary></indexterm>the file permissions you want. Note that <emphasis>umask</emphasis> works with numbers <indexterm><primary>numbers</primary></indexterm>only, for an explanation <indexterm><primary>explanation</primary></indexterm> please see, <xref linkend="file-permissions"></para><para>For example:</para><para>You want the default during a particular shell session <indexterm><primary>default</primary></indexterm>to be equivalent <indexterm><primary>equivalent</primary></indexterm>to<emphasis> chmod <indexterm><primary>chmod</primary></indexterm>750</emphasis> (user has r/w/x, group <indexterm><primary>group</primary></indexterm>has r/x and other has no permissions), then the command you would use would be:</para><screen><![CDATA[umask 027
]]></screen></listitem></varlistentry></variablelist><sect1 id="some-basic-security-tools"><title>Some basic Security Tools</title><para></para><variablelist><varlistentry><term>md5sum ]]></screen></listitem></varlistentry></variablelist><sect1 id="some-basic-security-tools"><title>Some basic Security Tools</title><para></para><variablelist><varlistentry><term>md5sum
</term><listitem><para><indexterm><primary>md5sum</primary></indexterm>Compute an md5 <indexterm><primary>md5</primary></indexterm>checksum (128-bit) for file &ldquo;file_name&rdquo; to verify <indexterm><primary>verify</primary></indexterm>it's integrity.<indexterm><primary>integrity</primary></indexterm> You normally use the &ldquo; md5sum -c&rdquo; <indexterm><primary>-c</primary></indexterm>option <indexterm><primary>option</primary></indexterm>to check <indexterm><primary>check</primary></indexterm>against a given file (often with a &ldquo;.asc&rdquo; extention) to check <indexterm><primary>check</primary></indexterm>whether the various files are correct,<indexterm><primary>correct</primary></indexterm> this comes in handy <indexterm><primary>handy</primary></indexterm>when downloading <indexterm><primary>downloading</primary></indexterm>isos as the checking <indexterm><primary>checking</primary></indexterm>is automated <indexterm><primary>automated</primary></indexterm>for you.</para><para>Command syntax:</para><screen><![CDATA[md5sum file_name </term><listitem><para><indexterm><primary>md5sum</primary></indexterm>Compute an md5 <indexterm><primary>md5</primary></indexterm>checksum (128-bit) for file &ldquo;file_name&rdquo; to verify <indexterm><primary>verify</primary></indexterm>it's integrity.<indexterm><primary>integrity</primary></indexterm> You normally use the &ldquo; md5sum -c&rdquo; <indexterm><primary>-c</primary></indexterm>option <indexterm><primary>option</primary></indexterm>to check <indexterm><primary>check</primary></indexterm>against a given file (often with a &ldquo;.asc&rdquo; extention) to check <indexterm><primary>check</primary></indexterm>whether the various files are correct,<indexterm><primary>correct</primary></indexterm> this comes in handy <indexterm><primary>handy</primary></indexterm>when downloading <indexterm><primary>downloading</primary></indexterm>isos as the checking <indexterm><primary>checking</primary></indexterm>is automated <indexterm><primary>automated</primary></indexterm>for you.</para><para>Command syntax:</para><screen><![CDATA[md5sum file_name
@ -1567,7 +1566,7 @@ Security Hazard
This is obviously a security hazard. You should avoid using the suid flag unless necessary. This is obviously a security hazard. You should avoid using the suid flag unless necessary.
</para> </para>
</caution> </caution>
</listitem></listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>chattr </listitem></varlistentry></variablelist><para></para><variablelist><varlistentry><term>chattr
</term><listitem><para><emphasis><indexterm><primary>chattr</primary></indexterm></emphasis>Change file system attributes (works on ext2fs and possibly others...). Use the <emphasis>-R</emphasis> option to change <indexterm><primary>change</primary></indexterm>files recursively,<emphasis> chattr </emphasis>has a large number <indexterm><primary>number</primary></indexterm>of attributes <indexterm><primary>attributes</primary></indexterm>which can be set <indexterm><primary>set</primary></indexterm>on a file, read the manual<indexterm><primary>manual</primary></indexterm> page <indexterm><primary>page</primary></indexterm>for further information.</para><para>Example:</para><screen><![CDATA[chattr +i /sbin/lilo.conf]]><footnote><para>This example and tiny parts of the explanation have been taken from the <productname>Linux</productname> Online Classroom, see [4] in the <xref linkend="references"> for further information. </para></footnote><![CDATA[ </term><listitem><para><emphasis><indexterm><primary>chattr</primary></indexterm></emphasis>Change file system attributes (works on ext2fs and possibly others...). Use the <emphasis>-R</emphasis> option to change <indexterm><primary>change</primary></indexterm>files recursively,<emphasis> chattr </emphasis>has a large number <indexterm><primary>number</primary></indexterm>of attributes <indexterm><primary>attributes</primary></indexterm>which can be set <indexterm><primary>set</primary></indexterm>on a file, read the manual<indexterm><primary>manual</primary></indexterm> page <indexterm><primary>page</primary></indexterm>for further information.</para><para>Example:</para><screen><![CDATA[chattr +i /sbin/lilo.conf]]><footnote><para>This example and tiny parts of the explanation have been taken from the <productname>Linux</productname> Online Classroom, see [4] in the <xref linkend="references"> for further information. </para></footnote><![CDATA[
]]></screen><para>This sets <indexterm><primary>sets</primary></indexterm>the 'immutable' flag <indexterm><primary>flag</primary></indexterm>on a file. Use a '+' to add <indexterm><primary>add</primary></indexterm>attributes <indexterm><primary>attributes</primary></indexterm>and a '-' to take them away. The +i will prevent <indexterm><primary>prevent</primary></indexterm>any changes (accidental or otherwise) to the &ldquo;lilo.conf&rdquo; file. If you wish to modify <indexterm><primary>modify</primary></indexterm>the lilo.conf file you will need to unset <indexterm><primary>unset</primary></indexterm>the immutable<indexterm><primary>immutable</primary></indexterm> flag:<indexterm><primary>flag</primary></indexterm><emphasis> chattr -i</emphasis>.<indexterm><primary>-i</primary></indexterm> Note some flags <indexterm><primary>flags</primary></indexterm>can only be used by root;<indexterm><primary>root</primary></indexterm> <emphasis>-i</emphasis>, <emphasis>-a</emphasis> and probably <indexterm><primary>probably</primary></indexterm>many others.</para><para>Note there are many different <indexterm><primary>different</primary></indexterm>attributes <indexterm><primary>attributes</primary></indexterm>that chattr can change,<indexterm><primary>change</primary></indexterm> here are a few more which may be useful:</para><itemizedlist><listitem><para>A<indexterm><primary>A</primary></indexterm> (no Access time) --- if a file or directory has this attribute set, whenever it is accessed,<indexterm><primary>accessed</primary></indexterm> either for reading <indexterm><primary>reading</primary></indexterm>of for writing,<indexterm><primary>writing</primary></indexterm> it's last <indexterm><primary>last</primary></indexterm>access time<indexterm><primary>access time</primary></indexterm> will not be updated.<indexterm><primary>updated</primary></indexterm> This can be useful, for example, on files or directories <indexterm><primary>directories</primary></indexterm>which are very often accessed <indexterm><primary>accessed</primary></indexterm>for reading, especially since this parameter is the only one which changes on an inode <indexterm><primary>inode</primary></indexterm>when it's opened.<indexterm><primary>opened</primary></indexterm></para></listitem><listitem><para>a<indexterm><primary>a</primary></indexterm> (append only) --- if a file has this attribute <indexterm><primary>attribute</primary></indexterm>set and is open for writing, the only operation possible will be to append <indexterm><primary>append</primary></indexterm>data <indexterm><primary>data</primary></indexterm>to it's previous contents. For a directory, this means that you can only add <indexterm><primary>add</primary></indexterm>files to it, but not rename <indexterm><primary>rename</primary></indexterm>or delete any existing <indexterm><primary>existing</primary></indexterm>file. Only root can set or clear this attribute.</para></listitem><listitem><para>s<indexterm><primary>s</primary></indexterm> (secure deletion) --- when such a file or directory with this attribute<indexterm><primary>attribute</primary></indexterm> set is deleted,<indexterm><primary>deleted</primary></indexterm> the blocks <indexterm><primary>blocks</primary></indexterm>it was occupying <indexterm><primary>occupying</primary></indexterm>on disk <indexterm><primary>disk</primary></indexterm>are written back with zeroes <indexterm><primary>zeroes</primary></indexterm>(similar to using <emphasis>shred</emphasis>). Note that this does work on the ext2,<indexterm><primary>ext2</primary></indexterm> and ext3 <indexterm><primary>ext3</primary></indexterm>filesystems but is unlikely to work on others (please see the documentation <indexterm><primary>documentation</primary></indexterm>for the filesystem <indexterm><primary>filesystem</primary></indexterm>you are using). You may also like to see <emphasis>shred</emphasis><indexterm><primary>shred</primary></indexterm>, please see <xref linkend="Working-with-the-file-system"></para></listitem></itemizedlist></listitem></varlistentry><varlistentry><term>lsattr ]]></screen><para>This sets <indexterm><primary>sets</primary></indexterm>the 'immutable' flag <indexterm><primary>flag</primary></indexterm>on a file. Use a '+' to add <indexterm><primary>add</primary></indexterm>attributes <indexterm><primary>attributes</primary></indexterm>and a '-' to take them away. The +i will prevent <indexterm><primary>prevent</primary></indexterm>any changes (accidental or otherwise) to the &ldquo;lilo.conf&rdquo; file. If you wish to modify <indexterm><primary>modify</primary></indexterm>the lilo.conf file you will need to unset <indexterm><primary>unset</primary></indexterm>the immutable<indexterm><primary>immutable</primary></indexterm> flag:<indexterm><primary>flag</primary></indexterm><emphasis> chattr -i</emphasis>.<indexterm><primary>-i</primary></indexterm> Note some flags <indexterm><primary>flags</primary></indexterm>can only be used by root;<indexterm><primary>root</primary></indexterm> <emphasis>-i</emphasis>, <emphasis>-a</emphasis> and probably <indexterm><primary>probably</primary></indexterm>many others.</para><para>Note there are many different <indexterm><primary>different</primary></indexterm>attributes <indexterm><primary>attributes</primary></indexterm>that chattr can change,<indexterm><primary>change</primary></indexterm> here are a few more which may be useful:</para><itemizedlist><listitem><para>A<indexterm><primary>A</primary></indexterm> (no Access time) --- if a file or directory has this attribute set, whenever it is accessed,<indexterm><primary>accessed</primary></indexterm> either for reading <indexterm><primary>reading</primary></indexterm>of for writing,<indexterm><primary>writing</primary></indexterm> it's last <indexterm><primary>last</primary></indexterm>access time<indexterm><primary>access time</primary></indexterm> will not be updated.<indexterm><primary>updated</primary></indexterm> This can be useful, for example, on files or directories <indexterm><primary>directories</primary></indexterm>which are very often accessed <indexterm><primary>accessed</primary></indexterm>for reading, especially since this parameter is the only one which changes on an inode <indexterm><primary>inode</primary></indexterm>when it's opened.<indexterm><primary>opened</primary></indexterm></para></listitem><listitem><para>a<indexterm><primary>a</primary></indexterm> (append only) --- if a file has this attribute <indexterm><primary>attribute</primary></indexterm>set and is open for writing, the only operation possible will be to append <indexterm><primary>append</primary></indexterm>data <indexterm><primary>data</primary></indexterm>to it's previous contents. For a directory, this means that you can only add <indexterm><primary>add</primary></indexterm>files to it, but not rename <indexterm><primary>rename</primary></indexterm>or delete any existing <indexterm><primary>existing</primary></indexterm>file. Only root can set or clear this attribute.</para></listitem><listitem><para>s<indexterm><primary>s</primary></indexterm> (secure deletion) --- when such a file or directory with this attribute<indexterm><primary>attribute</primary></indexterm> set is deleted,<indexterm><primary>deleted</primary></indexterm> the blocks <indexterm><primary>blocks</primary></indexterm>it was occupying <indexterm><primary>occupying</primary></indexterm>on disk <indexterm><primary>disk</primary></indexterm>are written back with zeroes <indexterm><primary>zeroes</primary></indexterm>(similar to using <emphasis>shred</emphasis>). Note that this does work on the ext2,<indexterm><primary>ext2</primary></indexterm> and ext3 <indexterm><primary>ext3</primary></indexterm>filesystems but is unlikely to work on others (please see the documentation <indexterm><primary>documentation</primary></indexterm>for the filesystem <indexterm><primary>filesystem</primary></indexterm>you are using). You may also like to see <emphasis>shred</emphasis><indexterm><primary>shred</primary></indexterm>, please see <xref linkend="Working-with-the-file-system"></para></listitem></itemizedlist></listitem></varlistentry><varlistentry><term>lsattr
</term><listitem><para><indexterm><primary>lsattr</primary></indexterm>(list attributes). This will list <indexterm><primary>list</primary></indexterm>if whether a file has any special <indexterm><primary>special</primary></indexterm>attributes (as set by chattr). Use the <emphasis>-R</emphasis> option to list recursively <indexterm><primary>recursively</primary></indexterm>and try using the <emphasis>-d<indexterm><primary>-d</primary></indexterm></emphasis> option <indexterm><primary>option</primary></indexterm>to list directories <indexterm><primary>directories</primary></indexterm>like other files rather than listing <indexterm><primary>listing</primary></indexterm>their contents.<indexterm><primary>contents</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[lsattr </term><listitem><para><indexterm><primary>lsattr</primary></indexterm>(list attributes). This will list <indexterm><primary>list</primary></indexterm>if whether a file has any special <indexterm><primary>special</primary></indexterm>attributes (as set by chattr). Use the <emphasis>-R</emphasis> option to list recursively <indexterm><primary>recursively</primary></indexterm>and try using the <emphasis>-d<indexterm><primary>-d</primary></indexterm></emphasis> option <indexterm><primary>option</primary></indexterm>to list directories <indexterm><primary>directories</primary></indexterm>like other files rather than listing <indexterm><primary>listing</primary></indexterm>their contents.<indexterm><primary>contents</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[lsattr
@ -1621,7 +1620,7 @@ For bzip2 the commands are prefixed with bz, <emphasis>bzcat, bzless, bzgrep</em
Note that the images are converted to the same size (scaled) so they can be tiled together. Note that the images are converted to the same size (scaled) so they can be tiled together.
</para> </para>
</note> </note>
</listitem></listitem></varlistentry><varlistentry><term>convert </listitem></varlistentry><varlistentry><term>convert
</term><listitem><para>To convert the file format <indexterm><primary>format</primary></indexterm>of an image to another image format. <emphasis>convert</emphasis> is used to change <indexterm><primary>change</primary></indexterm>a files format,<indexterm><primary>format</primary></indexterm> for example from a jpeg <indexterm><primary>jpeg</primary></indexterm>to a bitmap <indexterm><primary>bitmap</primary></indexterm>or one of many other formats.<indexterm><primary>formats</primary></indexterm><emphasis> convert </emphasis>can also manipulate <indexterm><primary>manipulate</primary></indexterm>the images as well (see the man <indexterm><primary>man</primary></indexterm>page <indexterm><primary>page</primary></indexterm>or the ImageMagick<indexterm><primary>ImageMagick</primary></indexterm> site).</para><para>Example from Jpeg <indexterm><primary>Jpeg</primary></indexterm>to PNG <indexterm><primary>PNG</primary></indexterm>format:</para><screen><![CDATA[convert JPEG: thisfile.jpg PNG: thisfile.png </term><listitem><para>To convert the file format <indexterm><primary>format</primary></indexterm>of an image to another image format. <emphasis>convert</emphasis> is used to change <indexterm><primary>change</primary></indexterm>a files format,<indexterm><primary>format</primary></indexterm> for example from a jpeg <indexterm><primary>jpeg</primary></indexterm>to a bitmap <indexterm><primary>bitmap</primary></indexterm>or one of many other formats.<indexterm><primary>formats</primary></indexterm><emphasis> convert </emphasis>can also manipulate <indexterm><primary>manipulate</primary></indexterm>the images as well (see the man <indexterm><primary>man</primary></indexterm>page <indexterm><primary>page</primary></indexterm>or the ImageMagick<indexterm><primary>ImageMagick</primary></indexterm> site).</para><para>Example from Jpeg <indexterm><primary>Jpeg</primary></indexterm>to PNG <indexterm><primary>PNG</primary></indexterm>format:</para><screen><![CDATA[convert JPEG: thisfile.jpg PNG: thisfile.png
]]></screen></listitem></varlistentry><varlistentry><term>import ]]></screen></listitem></varlistentry><varlistentry><term>import
</term><listitem><para><indexterm><primary>import</primary></indexterm>Captures screen-shots <indexterm><primary>screen-shots</primary></indexterm>from the X server <indexterm><primary>server</primary></indexterm>and saves <indexterm><primary>saves</primary></indexterm>them to a file. A screen-dump <indexterm><primary>screen-dump</primary></indexterm>of what X is doing.</para><para>Command syntax:</para><screen><![CDATA[import file_name </term><listitem><para><indexterm><primary>import</primary></indexterm>Captures screen-shots <indexterm><primary>screen-shots</primary></indexterm>from the X server <indexterm><primary>server</primary></indexterm>and saves <indexterm><primary>saves</primary></indexterm>them to a file. A screen-dump <indexterm><primary>screen-dump</primary></indexterm>of what X is doing.</para><para>Command syntax:</para><screen><![CDATA[import file_name
@ -1634,7 +1633,7 @@ Note that the images are converted to the same size (scaled) so they can be tile
Be careful when opening multiple large sized images (especially on a slow machine) and putting the slide show on a small delay between image changes. Your processor will be overloaded and it will take a significant amount of time to be able to close ImageMagick. Be careful when opening multiple large sized images (especially on a slow machine) and putting the slide show on a small delay between image changes. Your processor will be overloaded and it will take a significant amount of time to be able to close ImageMagick.
</para> </para>
</caution> </caution>
</listitem></listitem></varlistentry><varlistentry><term>identify </listitem></varlistentry><varlistentry><term>identify
</term><listitem><para>Will identify <indexterm><primary>identify</primary></indexterm>the type of image <indexterm><primary>image</primary></indexterm>as well as it's size,<indexterm><primary>size</primary></indexterm> colour <indexterm><primary>colour</primary></indexterm>depth and various other information. Use the<emphasis> -verbose <indexterm><primary>-verbose</primary></indexterm></emphasis> option <indexterm><primary>option</primary></indexterm>to show <indexterm><primary>show</primary></indexterm>detailed <indexterm><primary>detailed</primary></indexterm>information on the particular <indexterm><primary>particular</primary></indexterm>file(s). </para><para>Command syntax:</para><screen><![CDATA[identify image_name </term><listitem><para>Will identify <indexterm><primary>identify</primary></indexterm>the type of image <indexterm><primary>image</primary></indexterm>as well as it's size,<indexterm><primary>size</primary></indexterm> colour <indexterm><primary>colour</primary></indexterm>depth and various other information. Use the<emphasis> -verbose <indexterm><primary>-verbose</primary></indexterm></emphasis> option <indexterm><primary>option</primary></indexterm>to show <indexterm><primary>show</primary></indexterm>detailed <indexterm><primary>detailed</primary></indexterm>information on the particular <indexterm><primary>particular</primary></indexterm>file(s). </para><para>Command syntax:</para><screen><![CDATA[identify image_name
]]></screen></listitem></varlistentry><varlistentry><term>mogrify ]]></screen></listitem></varlistentry><varlistentry><term>mogrify
</term><listitem><para><indexterm><primary>mogrify</primary></indexterm><emphasis>mogrify</emphasis> is another ImageMagick <indexterm><primary>ImageMagick</primary></indexterm>command which is used to transform <indexterm><primary>transform</primary></indexterm>images in a number of different ways, including <indexterm><primary>including</primary></indexterm>scaling,<indexterm><primary>scaling</primary></indexterm> rotation <indexterm><primary>rotation</primary></indexterm>and various other effects.<indexterm><primary>effects</primary></indexterm> This command can work on a single file or in batch.<indexterm><primary>batch</primary></indexterm></para><para>For example, to convert a large number <indexterm><primary>number</primary></indexterm>of tiff <indexterm><primary>tiff</primary></indexterm>files to jpeg <indexterm><primary>jpeg</primary></indexterm>files you could type:</para><screen><![CDATA[mogrify -format jpeg *.tiff]]><indexterm><primary>-format</primary></indexterm><![CDATA[ </term><listitem><para><indexterm><primary>mogrify</primary></indexterm><emphasis>mogrify</emphasis> is another ImageMagick <indexterm><primary>ImageMagick</primary></indexterm>command which is used to transform <indexterm><primary>transform</primary></indexterm>images in a number of different ways, including <indexterm><primary>including</primary></indexterm>scaling,<indexterm><primary>scaling</primary></indexterm> rotation <indexterm><primary>rotation</primary></indexterm>and various other effects.<indexterm><primary>effects</primary></indexterm> This command can work on a single file or in batch.<indexterm><primary>batch</primary></indexterm></para><para>For example, to convert a large number <indexterm><primary>number</primary></indexterm>of tiff <indexterm><primary>tiff</primary></indexterm>files to jpeg <indexterm><primary>jpeg</primary></indexterm>files you could type:</para><screen><![CDATA[mogrify -format jpeg *.tiff]]><indexterm><primary>-format</primary></indexterm><![CDATA[
@ -1680,8 +1679,8 @@ Note that with mtools commands you can use the slashes on the a: part either way
]]></screen><para>This would run the shell <indexterm><primary>shell</primary></indexterm>script 1 hour <indexterm><primary>hour</primary></indexterm>from now.</para></listitem></varlistentry><varlistentry><term>atq ]]></screen><para>This would run the shell <indexterm><primary>shell</primary></indexterm>script 1 hour <indexterm><primary>hour</primary></indexterm>from now.</para></listitem></varlistentry><varlistentry><term>atq
</term><listitem><para><indexterm><primary>atq</primary></indexterm>Will list jobs currently in queue <indexterm><primary>queue</primary></indexterm>for the user who executed it, if root<indexterm><primary>root</primary></indexterm> executes at <indexterm><primary>at</primary></indexterm>it will list <indexterm><primary>list</primary></indexterm>all jobs <indexterm><primary>jobs</primary></indexterm>in queue <indexterm><primary>queue</primary></indexterm>for the at <indexterm><primary>at</primary></indexterm>daemon. Doesn't need or take any options.<indexterm><primary>options</primary></indexterm></para></listitem></varlistentry><varlistentry><term>atrm </term><listitem><para><indexterm><primary>atq</primary></indexterm>Will list jobs currently in queue <indexterm><primary>queue</primary></indexterm>for the user who executed it, if root<indexterm><primary>root</primary></indexterm> executes at <indexterm><primary>at</primary></indexterm>it will list <indexterm><primary>list</primary></indexterm>all jobs <indexterm><primary>jobs</primary></indexterm>in queue <indexterm><primary>queue</primary></indexterm>for the at <indexterm><primary>at</primary></indexterm>daemon. Doesn't need or take any options.<indexterm><primary>options</primary></indexterm></para></listitem></varlistentry><varlistentry><term>atrm
</term><listitem><para><indexterm><primary>atrm</primary></indexterm>Will remove <indexterm><primary>remove</primary></indexterm>a job <indexterm><primary>job</primary></indexterm>from the 'at' queue.<indexterm><primary>queue</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[atrm job_no </term><listitem><para><indexterm><primary>atrm</primary></indexterm>Will remove <indexterm><primary>remove</primary></indexterm>a job <indexterm><primary>job</primary></indexterm>from the 'at' queue.<indexterm><primary>queue</primary></indexterm></para><para>Command syntax:</para><screen><![CDATA[atrm job_no
]]></screen><para>Will delete <indexterm><primary>delete</primary></indexterm>the job <indexterm><primary>job</primary></indexterm>&ldquo;job_no&rdquo; (use <emphasis>atq</emphasis> to find out the number <indexterm><primary>number</primary></indexterm>of the job)</para></listitem></varlistentry><varlistentry><term>cron<emphasis> ]]></screen><para>Will delete <indexterm><primary>delete</primary></indexterm>the job <indexterm><primary>job</primary></indexterm>&ldquo;job_no&rdquo; (use <emphasis>atq</emphasis> to find out the number <indexterm><primary>number</primary></indexterm>of the job)</para></listitem></varlistentry><varlistentry><term><emphasis>cron</emphasis>
</term><listitem><para>cron<indexterm><primary>cron</primary></indexterm></emphasis> can be used to schedule <indexterm><primary>schedule</primary></indexterm>a particular <indexterm><primary>particular</primary></indexterm>function <indexterm><primary>function</primary></indexterm>to occur every minute,<indexterm><primary>minute</primary></indexterm> hour,<indexterm><primary>hour</primary></indexterm> day,<indexterm><primary>day</primary></indexterm> week, or month.<indexterm><primary>month</primary></indexterm> </para><para>It's normal <indexterm><primary>normal</primary></indexterm>to use the crontab <indexterm><primary>crontab</primary></indexterm>to perform the editing <indexterm><primary>editing</primary></indexterm>functions as this automates <indexterm><primary>automates</primary></indexterm>the process <indexterm><primary>process</primary></indexterm>for the cron <indexterm><primary>cron</primary></indexterm>daemon <indexterm><primary>daemon</primary></indexterm>and makes it easier for normal<indexterm><primary>normal</primary></indexterm> users to use cron.<indexterm><primary>cron</primary></indexterm></para><tip> </term><listitem><para><emphasis>cron<indexterm><primary>cron</primary></indexterm></emphasis> can be used to schedule <indexterm><primary>schedule</primary></indexterm>a particular <indexterm><primary>particular</primary></indexterm>function <indexterm><primary>function</primary></indexterm>to occur every minute,<indexterm><primary>minute</primary></indexterm> hour,<indexterm><primary>hour</primary></indexterm> day,<indexterm><primary>day</primary></indexterm> week, or month.<indexterm><primary>month</primary></indexterm> </para><para>It's normal <indexterm><primary>normal</primary></indexterm>to use the crontab <indexterm><primary>crontab</primary></indexterm>to perform the editing <indexterm><primary>editing</primary></indexterm>functions as this automates <indexterm><primary>automates</primary></indexterm>the process <indexterm><primary>process</primary></indexterm>for the cron <indexterm><primary>cron</primary></indexterm>daemon <indexterm><primary>daemon</primary></indexterm>and makes it easier for normal<indexterm><primary>normal</primary></indexterm> users to use cron.<indexterm><primary>cron</primary></indexterm></para><tip>
<title>Anacron</title> <title>Anacron</title>
<para><emphasis>anacron</emphasis> is another tool designed for systems which are not always on, such as home computers</para> <para><emphasis>anacron</emphasis> is another tool designed for systems which are not always on, such as home computers</para>
<para>While <emphasis>cron </emphasis>will not run if the computer is off, <emphasis>anacron </emphasis>will simply run the command when the computer is next on (it catches up with things).</para> <para>While <emphasis>cron </emphasis>will not run if the computer is off, <emphasis>anacron </emphasis>will simply run the command when the computer is next on (it catches up with things).</para>

View File

@ -1,5 +1,5 @@
<bibliography id="references" title="References"> <bibliography id="references">
<bibliodiv> <bibliodiv>
<biblioentry> <biblioentry>
<biblioset> <biblioset>
@ -271,6 +271,3 @@ This particular article by Kyle Rankin was used (only a paragraph) for informati
</biblioentry> </biblioentry>
</bibliodiv> </bibliodiv>
</bibliography> </bibliography>
</chapter>