diff --git a/LDP/guide/docbook/GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summary.sgml b/LDP/guide/docbook/GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summary.sgml index 9498abef..598a40f6 100644 --- a/LDP/guide/docbook/GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summary.sgml +++ b/LDP/guide/docbook/GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summary.sgml @@ -258,7 +258,7 @@ If you wish to make contributions it is recommended (if possible) to read the Ly LegalThe legal legalchapter provides information informationabout the disclaimer disclaimerthat applies to the entire document and the licensing licensinginformation.DisclaimerNo liability liabilityfor the contents contentsof this document documentscan be accepted. Use the concepts,concepts examples examplesand other content contentat your own risk.risk There may be errors errorsand inaccuracies,inaccuracies that may of course be damaging to your system. Although this is highly highlyunlikely, you should proceed proceedwith caution.caution The author authordoes not accept any responsibility responsibilityfor any damage damageincurred.All copyrights copyrightsare held by their respective ownersrespective owners, unless specificallyspecifically noted otherwise. Use of a term termin this document should not be regarded regardedas affecting the validity validityof any trademark trademarkor service markservice mark.Naming Namingof particular products productsor brands brandsshould not be seen as endorsements.endorsementsUNIX UNIXis a registered trademark trademarkof The Open GroupThe Open Group. LicenseCopyright Copyright© 2003 - 2006 Gareth Anderson.Gareth Anderson Permission Permissionis granted grantedto copy,copy distribute distributeand/or modify modifythis document under the terms termsof the GNU GNUFree Documentation License,GNU Free Documentation LicenseGFDL Version Version1.1 or any later version versionpublished by the Free Software Foundation;FSFFree Software Foundation with no Invariant InvariantSections,Sections with no Front-Cover Front-CoverTexts, and with no Back-Cover Back-CoverTexts.Texts A copy of the license licensecan be found in the section called the GNU Free Documentation License or at the GNU Documentation License Site.GNU Documentation License Site -The Unix Tools PhilosophyA tool is a simple program,program usually designed for a specific purpose, it is sometimes referred referredto (at least throughout this document) as a command.The “ Unix tools philosophy”Unix Tools Philosophy emerged emergedduring the creation of the UNIX UNIXoperating system, after the breakthrough invention inventionof the pipe pipe'|' (refer to for information on using the pipe).The pipe pipeallowed the output outputof one program to be sent to the input inputof another. The tools philosophy was to have small programs to accomplish a particular task instead of trying to develop large monolithic programs to do a large number of tasks. To accomplish more complex complextasks,tasks tools would simply be connected connectedtogether, using pipes.pipesAll the core coreUNIX system UNIX systemtools were designed designedso that they could operateoperate together. The original text-based text-basededitors (and even TeX TeXand LaTeXLaTeX) use ASCII ASCII(the American text encoding standard;American text encoding standard an open standard) and you can use tools such as; sed, awk, vi, grep, cat, more, tr and various other text-based text-basedtools in conjunction conjunctionwith these editors.editors Using this philosophy philosophyprogrammers programmersavoided writing writinga program (within their larger program) that had already been written by someone else (this could be considered a form of code coderecycling). For example, command-linecommand-line spell spellcheckers are used by a number of different applications instead of having each application applicationcreate its own own spell checker.checkerThis philosophy philosophylives on today todayin GNU/Linux and various other UNIX system-based operating systems (FreeBSD,FreeBSD NetBSD,NetBSD OpenBSD,OpenBSD etc.).For further information (articles) on the UNIX tools philosophy UNIX tools philosophyplease see the further reading further readingsection, here: +The Unix Tools PhilosophyA tool is a simple program,program usually designed for a specific purpose, it is sometimes referred referredto (at least throughout this document) as a command.The “ Unix tools philosophy”Unix Tools Philosophy emerged emergedduring the creation of the UNIX UNIXoperating system, after the breakthrough invention inventionof the pipe pipe'|' (refer to for information on using the pipe).The pipe pipeallowed the output outputof one program to be sent to the input inputof another. The tools philosophy was to have small programs to accomplish a particular task instead of trying to develop large monolithic programs to do a large number of tasks. To accomplish more complex complextasks,tasks tools would simply be connected connectedtogether, using pipes.pipesAll the core coreUNIX system UNIX systemtools were designed designedso that they could operateoperate together. The original text-based text-basededitors (and even TeX TeXand LaTeXLaTeX) use ASCII ASCII(the American text encoding standard;American text encoding standard an open standard) and you can use tools such as; sed, awk, vi, grep, cat, more, tr and various other text-based text-basedtools in conjunction conjunctionwith these editors.editors Using this philosophy philosophyprogrammers programmersavoided writing writinga program (within their larger program) that had already been written by someone else (this could be considered a form of code coderecycling). For example, command-linecommand-line spell spellcheckers are used by a number of different applications instead of having each application applicationcreate its own spell checker.checkerThis philosophy philosophylives on today todayin GNU/Linux and various other UNIX system-based operating systems (FreeBSD,FreeBSD NetBSD,NetBSD OpenBSD,OpenBSD etc.).For further information (articles) on the UNIX tools philosophy UNIX tools philosophyplease see the further reading further readingsection, here: Shell TipsThe shell shelltips chapter provides handy tricks that you may wish to use when you are using a GNU/Linux shell (the command-linecommand-line interface). This information includes handy handyshortcut shortcutkey combinations,key combinations the shell's command historycommand history and information on virtual terminals.virtual terminals If you can't boot into your system If your having problems booting into your system you may like to use a shell so you can boot into your system and attempt to fix things up again. @@ -380,7 +380,7 @@ Using echo allows you to expand the wildcards to understand The command-line historyUsing the command history command historyUse the up and down key's to scroll scrollthrough previously typed commands. Press [Enter] to execute executethem or use the left and right arrow arrowkeys to editedit the command first. Also see history (below).The history command The history history command can be used to list Bash's log logof the commands you have typed:This log logis called the “history”. To access accessit type:This will only list the last lastn commands. Type “history” (without options) to see the the entire history historylist.listYou can also type !n!n to execute command numbercommand number n. Use !!!! to execute the last command you typed.!-n!-n will execute the command n times timesbefore (in other words !-1 is equivalent equivalentto !!). !string!string will execute the last command starting startingwith that “string” and !?string? will execute the last command containing the word “string”. For example:This will only list the last lastn commands. Type “history” (without options) to see the entire history historylist.listYou can also type !n!n to execute command numbercommand number n. Use !!!! to execute the last command you typed.!-n!-n will execute the command n times timesbefore (in other words !-1 is equivalent equivalentto !!). !string!string will execute the last command starting startingwith that “string” and !?string? will execute the last command containing the word “string”. For example:Will re-run the command that you last typed starting with “cd”.“ commandName commandName!*” will execute the “commandName” with any arguments argumentsyou used on your last command. This maybe useful if you make a spelling spellingmistake, for example. If you typed:In an attempt attemptto execute emacs emacson the above two files this will obviously fail.fail So what you can do is type:This will execute emacs emacswith the arguments argumentsthat you last typed on the command-line.command-line In other words this is equivalent equivalentto typing:Displays text, one page full at a time,time more limited than less. In this case less is better than more.Or using a tool (is this example cat):cat -Combines Combines(concatenates) multiple multipledocuments documentsinto one document.document Can be used on individual individualfiles as well.Some useful options:options-b-b --- number numberall non-blank non-blanklines-n-n --- number all lines. Also try using nl to number lines (it can do more complex complexnumbering), you will find it under under this section,section Example: wholefile.txt +Combines Combines(concatenates) multiple multipledocuments documentsinto one document.document Can be used on individual individualfiles as well.Some useful options:options-b-b --- number numberall non-blank non-blanklines-n-n --- number all lines. Also try using nl to number lines (it can do more complex complexnumbering), you will find it under this section,section Example: wholefile.txt ]]>This will combine combine(concatenate) filepart1,filepart1 filepart2 filepart2and filepart3 filepart3into the single file “wholefile.txt”.tac tacCombines (concatenates) multiple multipledocuments documentsinto one document documentand outputsoutputs them in reverse order.reverse Can also be used on individual individualfiles. Notice that tac is cat written backwards. Example: wholefile.txt ]]>This will combine combine(concatenate) filepart1,filepart1 filepart2 filepart2and filepart3 filepart3into the single file but have each of the files written in reverse.reversez* commands @@ -1283,8 +1283,8 @@ You could also change the command it runs for example if you changed the This will run aspell on a particular file called “FILE.txt”, aspell will run interactively and prompt promptfor user input.ispell example:This will run ispell on a particular file called “FILE.txt” ispell will run interactively and prompt promptfor user input.chcase chcaseIs used to change the uppercase uppercaseletters in a file name to lowercaselowercase (or vice versa).You could also use trtr to do the same thing... newFileName.txt -]]>The above would convert convertuppercase to lowercase using the the file “fileName.txt” as input inputand outputting the results resultsto “newFileName.txt”. newFileName.txt -]]>The above would convert lowercase to uppercase using the the file “fileName.txt” as input inputand outputting the results resultsto “newFileName.txt”.chcase (a perl perlscript) can be found foundat the chcase homepage.chcase homepagefmt +]]>The above would convert convertuppercase to lowercase using the file “fileName.txt” as input inputand outputting the results resultsto “newFileName.txt”. newFileName.txt +]]>The above would convert lowercase to uppercase using the file “fileName.txt” as input inputand outputting the results resultsto “newFileName.txt”.chcase (a perl perlscript) can be found foundat the chcase homepage.chcase homepagefmt fmt(format) a simple text formatter. Use fmt fmtwith the -u-u option to output text with "uniform spacing", where the space spacebetween words is reduced to one space character characterand the space between sentences sentencesis reduced to two space characters. Example:Will make sure the amount amountof space between sentences sentencesis two spaces and the amount amountof space between words is one space.paste pastePuts lines from two files together, either lines of each file side by side (normally separated separatedby a tab-stop tab-stopbut you can have any symbols(s) you like...) or it can have words from each file (the first file then the second file) side by side.To obtain a list listof lines side by side, the first lines from the first file on the left side separated separatedby a tab-stop tab-stopthen the first lines from the second file. You would type:This would run the echo echocommand with the string stringshown at 4:05 every Sunday. MiscellaneousThe miscellaneous miscellaneouschapter contains commands that don't really fit into the other sections sectionsof this guide.renaming extensions renaming extensionsTo rename renameall of the files in the current currentdirectorydirectory with a '.htm' extension extensionto '.html', type:-xYou can get a copy copyof the chcase chcase perl perlscript here.For more morecomplex complexrenaming renamingyou should read relThis information information comes from the Linux Cookbook (without editing). See [3] in the for further information. +]]>You can get a copy copyof the chcase chcase perl perlscript here.For more morecomplex complexrenaming renamingyou should read relThis information comes from the Linux Cookbook (without editing). See [3] in the for further information. Use rel relto analyze analyzetext files for relevance relevanceto a given set of keywords.keywords It outputs outputsthe names of those files that are relevant relevantto the given keywords, ranked rankedin order orderof relevance;relevance if a file does not meet the criteria,criteria it is not outputted in the relevance relevancelisting.units man page units man pageThere is a man page, part of the Linux Programmers ProgrammersManual called “units”. It displays various information informationon the various scientific scientificmeasurementsmeasurements (such as mega,mega giga gigaet cetera). This manual manualpage pagealso has a short discussion about the argument argumentover whichwhich standard standardshould be used to measure measuredata (ie. the kibibyte kibibytevs kilobyte). To access accessthis man page type:fortune