]> GNU/Linux Command-Line Tools Summary Gareth Anderson
somecsstudent(at)gmail.com
Conversion from LyX to DocBook SGML, Index generation Chris Karakas
Linux Unix commands Linux commands Unix commands Linux tools Unix tools tutorial command line prompt command reference command tutorial command line reference command line tutorial tools tutorial tools reference tool linux command reference linux command tutorial linux command line reference linux command line tutorial linux tools tutorial linux tools reference linux tool Unix command reference Unix command tutorial Unix command line reference Unix command line tutorial Unix tools tutorial Unix tools reference Unix tool This document is an attempt to provide a summary of useful command-line tools available to a GNU/Linux based operating system, the tools listed are designed to benefit the majority of users and have being chosen at the authors discretion. This document is not a comprehensive list of every existent tool available to a GNU/Linux based system, nor does it have in-depth explanations of how things work. It is a summary which can be used to learn about and how to use many of the tools available to a GNU/Linux based operating system. 1.1 28th February 2006 CK Corrected typos, generated new index (9000 index entries!). 1.0 6th February 2006 GA Major restructuring, now in a docbook book format. Removed large chunks of content and revised other parts (removed chapters and sectioned some areas more). This is likely the final release by the author, I hope that someone finds this guide useful as I do not intend to continue work on this guide. 0.7.1 25th February 2005 CK Set special characters in math mode, produced PDF and PS with Computer Modern fonts in OT1 encoding and created correct SGML for key combinations. 0.7 5th December 2004 GA Updated document with new grammatical review. Re-ordered the entire Text section. Removed a fair amount of content. v0.6 20th April 2004 GA Attempted to fix document according to TLDP criticisms. Added notes and tips more sectioning. Now complying to the open group standards for the UNIX system trademark. Document should be ready for TLDP site. v0.5 6th October 2003 GA Fixed a variety of errors as according to the review and made some consistency improvements to the document. v0.4 15th July 2003 GA Made small improvements to the document as suggested (so far) by the thorough TLDP review, improved consistency of document and made small content additions. v0.3 26th June 2003 GA Minor errors fixed, updated the appendix with information for finding where a tool is from. Fixed referencing/citation problems and improved further reading and intro sections, added an audio section. v0.2 20th April 2003 GA This is the initial public release. Added more code-style then before, broke text-section into more subsections. Improved consistency of document and fixed various index entries. v0.1 27th March 2003 GA This is the initial draft release (the first release to be converted from LyX to DocBook SGML).
IntroductionThis document documentis an attempt attemptto summarise summarisethe many command-line-based command-line-basedtoolstools available availableto a GNU/Linux based operating operatingsystem.system This guide guideis not a complete completelisting (I doubt it's possible possibleto documentdocument all available availableprograms), this document documentlists listsmany tools toolswhich are available to GNU/Linux systems systemsand which whichare, or can be useful to the majority majorityof users.usersEach tool tooldescription descriptionprovides a quick quickoverview of it's function functionand some useful options optionsfor that individual individualtool.toolThe tools toolslisted listedthat require requirea GUI,GUI usually the X windowing windowingsystem,system are those listed listedin the Graphics GraphicsTools section.section All other tools toolsare completely command-line-based command-line-basedand do not require requirea GUI GUIto run.run If you are looking lookingfor information informationon GUI GUIbased tools toolsyou will need to looklook elsewhere.Also note that a few of the tools toolsin this guide guideare bash bash(the Bourne-Again-SHellBourne-Again-SHell) specific, tools toolsspecific specificto other shells shellsare not listed listedin this document.documentFor some of the tools toolsthat are harder to use, or perform performa more morecomplexcomplex task,task there are several severalmini-tutorials mini-tutorials(or mini-guides;mini-guides ) within this document.documentWhere a mini-guide mini-guidewas considered unncessary,unncessary detailed detaileddescriptions that explain explainin detail detailhow a particular particulartool toolworks,works and some examples examplesof how to use it are provided.providedPlease note that the word word“tool” is used interchangeably interchangeablywith the word word“command”, both have the same meaning meaning(at least leastin this guide). For a more moredetailed detailedexplanation, read readabout the UNIX UNIXTools Philosophy Philosophyhere: or visit visitthe links linksin the appendix,appendix . To find out which tools are bash specific To find out which tools are bash specific you can type: enable -a FormatsThis document documentis available availablein the following followingformats:formatsHTML (HyperText Markup Language), many HTML HTMLfiles,files one per section,section for viewing viewingwith any browserHTML (HyperText Markup Language), one big HTML HTMLfileTXT (ASCII Text)RTF (Rich Text Format)PDF (Portable Document Format)PS.GZ (Compressed Postscript)SGML (Standard Generalized Markup Language)(with the Appendix and the Bibliography)LYX (LaTeX frontend LyX)(with the Appendix and the Bibliography) RTF: Page numbers In order to get correct page numbers (and often to get the images working) in Microsoft Word, type the following after opening the document: CTRL END CTRL A F9 In Word Viewer 97, you must instead do: CTRL END ALT V N ALT V P See The OpenJade RTF backend for more details. Important: Downloads for offline reading! If you want to download the HTML or RTF formats for offline reading, you will need to download the images as well - PNG for HTML and BMP for RTF, including the callouts! To save you the hassle, I have compiled the following gzipped tar archives for offline reading: TAR.GZ (Compressed TAR Archive), many HTML files with images TAR.GZ (Compressed TAR Archive), one big HTML file with images TAR.GZ (Compressed TAR Archive), SGML file with images TAR.GZ (Compressed TAR Archive), RTF file with imagesA tarball tarballcontaining all the above is also available:available TAR.GZ (Compressed TAR Archive), All files Who would want to read this guide?Anyone who is interested in learning learningabout the tools tools(also known as commands) available availableto them when using their GNU/Linux based operating operatingsystem.systemWhy would you want to learn learnhow to use the command commandline (and available availabletools)? The Command Line Interface (CLI), while difficult to learn,learn is the quickest quickestand most efficient efficientway to use a computer computerfor many different differenttasks.tasks The CLI CLIis the normal normalmethod of use for most UNIX UNIXsystem systemadministrators,administrators programmers programmersand some power powerusers. While a GUI GUIis better suited suitedto some tasks,tasks many operations operationsare best suited to the CLI.CLIThe major majormotivation behind learning learningthe GNU/Linux CLI CLIis the authors authorsideaidea that, with software softwarein general,general the more moretime timespent learning learningsomething equals equalsless lesstime timespent performing performingthat particular particulartask task(authors opinion opiniononly).This guide guideis aimed at beginners beginnersto intermediate intermediateusers who want to learnlearn about the commandline commandlinetools available availableto them. Advanced users usersmay wish to use it as a command commandreference,reference however this document documentaims to list listcommands commandsof interest, as judged judgedby the authors authorsopinion,opinion it is not designed designedto be completely comprehensive,comprehensive see the appendix,appendix for further information.information Or if you are not looking lookingfor a command commandreference referenceguide, but a more moregentlegentle introduction introductionto GNU/Linux you may be interested in the Introduction to Linux guide authored authoredby Machtelt Garrels.GarrelsThis guide guidecould also be considered a summarised summarisedversion versionof the Linux LinuxCookbook.Cookbook If you are looking lookingfor a book bookwith more moredetailed detaileddescriptions of each tooltool have a look lookat the Linux Cookbook Homepage, also check checkout the command list from "Linux in a Nutshell 3rd Edition" for an index indexof 300+ commands commandsand their explanations.explanations Who would not want to read this guide?Anyone who is not interested in the command commandline, or anyone looking lookingfor a detailed detailedreference referenceto all available availableGNU/Linux tools toolsshould look lookelsewhere. This is only a summary,summary while it does list listmany commands,commands it's not a completecomplete listing listing(I don't think it's possible possibleto make a complete completelisting anyway).This document documentwould not be unlikely unlikelyto be of interest to those who already have an expert expertknowledge knowledgeof the command commandline interface interfaceand do require requireany reference referenceinformation.information Or those readers readerswho require requiredetailed detailedlists listsof options optionsfor each command,command the man manpages pagesare better suited suitedto this purpose.purpose Availability of sourcesThe modifiable modifiablesources sourcesof the original originalbook book(in english), are availableavailable in LyX LyXformat format(LyX Document DocumentProcessor) or Machine-translated Machine-translatedSGML SGML(SGML markup markuplanguage). LyX LyXis a completely free freedocument processor processorbased on LaTeX,LaTeX downloadabledownloadable from the LyX homepage..See for the modifiable modifiablesources sourcesof this document.document These are the official officialversions.versions We (the translators translatorsand current currentmaintainers) plan planto continue work workon this document documentand add addnew newchapters and enhancements.enhancements If you want to see the version versionwe are currently working workingon (the "bleeding edge" version), check checkthe GNU/Linux Command-Line Tools Summary Homepage from time timeto time time(kindly hosted hostedby Chris Karakas). Conventions used in this guidesansThe following followingconventions conventionsare used within this guide:guide italic italicAnything appearing in italic, like this is either an executable executablecommand commandor emphasized emphasizedtext.text Tools Tools(executable commands) are in italics italicsto prevent preventconfusion. Some tools toolshave names which whichare real realenglish englishwords,words such as the “locate” tool.toolkey  combinations combinationsAre represented representedby using a '-' (dash sign) inbetween the key(s), which whichmust mustbe used in combination.combination All combinations combinationsare also printed printedin italics italicsto improve improveclarity.clarity For example example CTRL Z CTRL-Z means hold down the Control Controlkeykey and press pressthe z key. admonitions admonitionsAdmonitions are little pictures picturesused to emphasize emphasizesomething of importance importanceto the reader.reader The five fivetypes used are: This is a note Notes often give important information about a tool. This is a tip This will offer a useful switch or useful way to use a tool. This is something important This is something that is considered very important. Consider it like a note with extra importance, they are usually there to save the reader time. This is a caution This will inform you of something that you be careful about (because it could be harmful to your system). This is a warning This will inform you of something that you shouldn't do (because it probably will break something within your system). code examples Code Codeexamples examplesare shown shownfor most commands.commands Below is an example exampleof what code codelooks like:command  syntax syntax(or a similar similarphrase) simply shows showshow you would normally use the command.command Often real realexamples examplesare used instead of explaining explainingthe command commandsyntax.syntax The phrase phrase“ Command Commandsyntax” is always followed followedby the way you would type a command commandin a shell.shellThe standard standardsyntax syntaxfor any tool toolis usually: Note Note that some tools do not accept options. wildcards wildcardsAlso note that most commands,commands even evenwhen not explicitly explicitlystated,stated will work workwith standard standardwildcards standard wildcardswildcards(or globbing globbingpatterns) such as *, [A-Z] and various other standard standardwildcards.standard wildcardswildcards Refer Referto for further information.informationaccess  keys keysAccess Accesskeys enable enablenavigation through the document,document without relying on a mouse.mouse The following followingkeys have been given special specialmeaning meaningin this document:documentP Previous Previouspage.pageN Next Nextpage.pageH Home Homeof the document document(Table of Contents).U Up (takes you one level levelup the section sectionhierarchy).If you also happen to be reading readingthe document documentfrom its original originallocation,location then the following followingaccess accesskeys can also be used:S Start Start(takes you to the author's start startpage).T The current current(“This”) page,page without the Sitemenu Sitemenuon the left.leftM The current currentpage pagein a frameset,frameset where the left leftframe framecontains a Menu.Menu To use the access keys, you have to simultaneously press a modifier key, which may vary from browser to browser. For example in NN6+/Mozilla, the modifier key is ALT, so you have to use ALT N to go to the next page, and ALT P to come back. In other browsers such as IE6, the access keys just give focus to the associated link, so the sequence becomes ALT N Enter . Try it, you'll like it! ]]> ]]> ]]> ]]> Inline graphic Resources used to create this document To create the GNU/Linux Command-Line Command-LineTools Summary,Summary I used LyX, the document documentprocessor.processor To convert convertthe LyX LyXfiles filesto DocBook DocBookSGML SGMLI used the LyX-to-X Scripts created by Chris Karakas.Karakas, ChrisYou may also want to check checkout the db2lyx package,package created by Dr. B Guillion,Guillion, B. Dr. which whichcan be used to convert convertLyX files filesto XML XMLDocBook and XML DocBook DocBookto LyX.LyX I also had assistance assistancefrom various The Linux Documentation Project volunteers volunteers(see the contributors contributorssection section for specific specificdetails). FeedbackFeedback Feedbackis necessary for the advancement advancementof this guide.guide Positive,Positive constructive criticism criticismis encouraged.encouraged If you have ideas,ideas suggestions,suggestions advice,advice or problems problemswith this guide,guide please send sendan email emailto the author authorGareth Anderson. Anderson, Gareth Contributions If you wish to make contributions it is recommended (if possible) to read the LyX file(s) for this document. They contain various notes which you can't see in the other versions. These notes highlight the areas that need contributions, certain tools which I cannot understand, tools which have not been added, or tools which were removed. These notes also explain some of the structure of this document. Contributors As you may be able ableto see, parts partsof this guide guideare based off offvarious adviceadvice columns columnson GNU/Linux, anything that has being directly quoted quotedfrom an articlearticle can be found foundin the references,references , section sectionof this document.document The following followingis a list listof people peoplewho have made a significant significantcontributioncontribution to this document,document in a rough roughchronological chronologicalorder.Chris Karakas: ChrisKarakas, Chris allowed allowedthe use of his lyxtox lyxtoxscripts scriptsto convert convertthe LyX LyXfile of the document documentto working workingDocBook SGML SGMLoutput (to learn learnhow to use the lyxtoxlyxtox scripts scriptsyourself, see Document processing with LyX and SGML).Chris provided provideduseful suggestions suggestionsand advice,advice and added an index indexlistinglisting for many of the commands.commands Chris is also responsible responsiblefor the great greatlooking HTML HTMLfile for this documentdocument (the CSS CSSfile and HTML HTMLcustomisations customisationsare completely his work).Chris has also helped helpedfix up problems problemsin the document document(many times), especiallyespecially with docbook/sgml related problems problemsand LyX LyXrelated issues.issuesChris has also improved improvedthe structure structureof the document documentby adding addinglabels and fixing fixingminor minorerrors.William West: William West, Williamprovided a thorough review reviewof the document documentas requiredrequired by the Linux Documentation Project. He is responsible responsiblefor a variety varietyof improvements improvementsto the quality qualityof this document.documentHis contributions contributionsinclude:include Improvements Improvementsto the readability readabilityof this document.document Improvements Improvementsto the structure structureand consistency consistencyof this document.document Various grammar grammarimprovements throughout the document.document Repair Repairof some minor minortechnical errors.errorsTabatha Persad: Persad, TabathaTabatha, as the Linux Documentation Project Review ReviewCoordinator (at the time) also gave gavea brief review reviewof this document.document Her general generaladvice was used to improve improvethe structure,structure language languageand grammargrammar of the document.documentRahul Sundaram: Sundaram, RahulRahul provided provideda brief review reviewof this document documentfor the Linux Documentation Project. Advice from his brief review reviewwas integrated integratedinto this document documentto improveimprove readability readabilityand structure,structure several severalreferences referenceswere added as recommendedrecommended by Rahual.David Lawyer: Lawyer, DavidDavid's criticism criticismof the document document(via the TLDP TLDPdiscuss discusslist) were listened listenedto, and attempts attemptsto improve improvethe document documentwere made. A number numberof his criticisms criticismswere addressed addressedand improved.improved George Harmon: Harmon, GeorgeGeorge provided provideda second language languagereview.review His detailed detailedreview of the material materialallowed allowedme to improve improvethe general generalgrammargrammar of the document documentand some minor minorerrors.Machtelt Garrels (tille): Garrels, MachteltMachtelt provided providedtips in regard regardto referencingreferencing the correct correctLDP documents documentsfrom this guide.guide As well as general generaladvice on improvements improvementsto the guide.guide LegalThe legal legalchapter provides providesinformation informationabout the disclaimer disclaimerthat applies to the entire entiredocument and the licensing licensinginformation.informationDisclaimerNo liability liabilityfor the contents contentsof this documents documentscan be accepted.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.system Although this is highly highlyunlikely,unlikely you should proceed proceedwith caution.caution The author authordoes not accept acceptany responsibility responsibilityfor any damage damageincurred.All copyrights copyrightsare held by their respective respectiveowners, unless unlessspecificallyspecifically noted otherwise. Use of a term termin this document documentshould not be regarded regardedas affecting the validity validityof any trademark trademarkor service servicemark. Naming Namingof particular particularproducts productsor brands brandsshould not be seen as endorsements.endorsements UNIX UNIXis a registered registeredtrademark trademarkof The Open OpenGroup. License Copyright Copyright© 2003 - 2006 Gareth Anderson.Anderson Permission Permissionis granted grantedto copy,copy distribute distributeand/or modify modifythis document documentunder the terms termsof the GNU GNUFree FreeDocumentation License,LicenseGNU Free Documentation License} Version Version1.1 or any later version versionpublished by the Free FreeSoftware Foundation;FoundationFree Software Foundation} with no Invariant InvariantSections,Sections with no Front-Cover Front-CoverTexts, and with no Back-Cover Back-CoverTexts.Texts A copy copyof the license licensecan be found foundin the section sectioncalled the GNU GNUFree FreeDocumentation License Licenseor at the GNU Documentation License Site. The Unix Tools PhilosophyA tool toolis a simple program,program usually designed designedfor a specific specificpurpose, it is sometimes referred referredto (at least leastthroughout this document) as a command.commandThe “ Unix Unixtools toolsphilosophy” emerged emergedduring the creation creationof the UNIX UNIXoperating system,system after the breakthrough invention inventionof the pipe pipe'|' (refer to for information informationon using the pipe).The pipe pipeallowed the output outputof one program programto be sent to the input inputof another. The tools toolsphilosophy was to have small smallprograms programsto accomplish accomplisha particularparticular task taskinstead of trying tryingto develop developlarge monolithic monolithicprograms programsto do a large number numberof tasks.tasks To accomplish accomplishmore morecomplex complextasks,tasks tools toolswould simply be connected connectedtogether,together using pipes.pipesAll the core coreUNIX UNIXsystem systemtools were designed designedso that they could operateoperate together.together The original originaltext-based text-basededitors (and even evenTeX TeXand LaTeX) use ASCII ASCII(the American Americantext encoding encodingstandard; an open openstandard) and you can use toolstools 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 program(within their larger program) that had already been written writtenby someone else (this is sometimes called code coderecycling). For example,example command commandline spell spellcheckers are used by a number numberof differentdifferent applications applicationsinstead of having each application applicationcreate its own own spellspell checker.checkerThis philosophy philosophylives on today todayin GNU/Linux and various other UNIX UNIXsystem-based operating operatingsystems systems(FreeBSD, NetBSD,NetBSD OpenBSD,OpenBSD etc.).For further information information(articles) on the UNIX UNIXtools philosophy philosophyplease see the further reading readingsection,section here: Shell TipsThe shell shelltips chapter provides provideshandy tricks tricksthat you may wish to use when you are using a GNU/Linux shell shell(the command commandline interface). This information informationincludes handy handyshortcut shortcutkey combinations,combinations the shell's command commandhistory and information informationon virtual virtualterminals. 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. To do this you need to pass the “init=/bin/sh” to your system before you boot up. If you don't know how to do this please see , the technique is the same except this time you pass "init=bin/sh" rather than "single". General Shell TipsAutomatic Command  Completion CompletionUse the TAB TABkey and BASH BASHwill attempt attemptto completecomplete the command commandfor you automatically.automatically You can use it to complete completecommand (tool) names. You can also use it when working workingwith the file-system,file-system when changing directories, copying copyingfiles et cetera.ceteraThere are also other lesser lesserknown ways to use automatic automaticcommand completioncompletion (for example examplecompleting completinguser usernames):This information was adopted (with editing) from Mandrakesoft's Command Line Manual, see [7] in the for further information. ESC Y ESC-Y  (Y: special character) Will attempt attemptto complete completethe command commandname for you. If it fails failsit will either list listthe possible possiblecompletions completions(if they exist). If there are none noneit will simply beep beep(and/or) flash flashthe screen.screen CTRL X Y CTRL-X-Y  (Y: special character) Lists Liststhe possible possiblecompletions completions(it won't attemptattempt to complete completeit for you) or beep beepif there are no possible possiblecompletions.completionsSpecial-characters:Use the following followingspecial specialcharacters combined combinedwith either ESC Y ESC-Y or CTRL X Y CTRL-X-Y , where Y is some special specialcharacter.character For example example ESC $ ESC-$ or CTRL X $ CTRL-X-$ to complete completean environment environmentvariable name.~ (tilde) tilde~complete completea user username@ (at sign) at, sign@complete completea machine machinename$ (dollars sign) dollar sign$complete completean environment environmentvariable name! (exclamation mark) exclamation mark!a magic magiccharacter characterfor completing completinga command commandname or a file filename (/). The ! special specialcharacter characterhas the same function functionas the TAB TABkey. It works worksin some other situations; for example examplewhen completing completingman pagepage names. alias aliasThe alias command commandwill list listyour current currentaliases.aliases You can use unalias to remove removethe alias alias(to disable disableit just for one command commandadd a “\” (back-slash) before the command)...An alias aliasallows allowsone command commandto be substituted substitutedfor another. This is used to make a command commanddo something else or to automatically automaticallyaddadd certain options.options This can be either be done during one session sessionusing the alias aliascommand command(see below) or the information informationcan be added to the .bashrc file file(found in the users usershome homedirectory).Below is an example exampleof what an alias aliassection section(within your .bashrc file) might look looklike:On any Mandrake/Mandriva Linux Linuxsystem systemthe global globalaliases aliases(for all users) are all in /etc/profile.d/alias.sh. The above listed listedcommands already have aliases,aliases as well as several severalother commonly commonlyused commands.commandsset  -x -x set setis one of bash's inbuilt inbuiltcommands,commands try trylooking in the bash bashmanual for its many usage usageoptions.optionsUsing set with the -x -x option optionwill make bash bashprint out each command commandit is going to run runbefore it runs runsit. This can be useful to find findout what is happening with certain commands commandssuch as things being quoted quotedthat contain wildcards wildcardsor special specialsymbols symbolsthat could cause causeproblems, or complex complexaliases.aliases Use set set+x to turn turnthis back off.offExamplesAfter using set set-x you can run runthe command:commandThe output outputprinted printedbefore the command commandruns (for example):Which means that the command commandis really reallyan alias aliasto run runls with the -F and --color=auto options.options Use a “\” (backslash) before the command commandto run runit without the alias.alias\ (backslash) \The backslash backslashescape character charactercan be used before a shell shellcommand to override overrideany aliases.aliasesFor example exampleif rm was made into an alias aliasfor rm rm-i-i then typing “rm” would actually run run rm rm-i-i. However, typing \rm lets the shell shellignore the alias aliasand just run runrm (its runs runsexactly what you type), this way it won't confirm confirmif you want to delete deletethings. Using rm Please note that the alias for the remove command is there for a reason. Using it incorrectly could remove files which you don't want removed. Only use \rm if you know exactly what you are doing (recovering files is not easy, rm does not send things to a recycle bin). The “\” character charactercan be used before special specialcharacters (such as a space spaceor a wildcard.wildcard..) to stop stopbash bashfrom trying tryingto expand expandthem (a directory directoryname with a spacespace in it is possible possiblethis way). For example exampleyou could type cd My\ DirectoryDirectory\ With\ SpacesSpaces which whichnormally wouldn't work.work The “\” character charactercan also be used to stop stopbash bashfrom expanding expandingcertain symbolssymbols (as an alternative alternativeyou could use single quotation quotationmarks, although you may need to use both). The TAB Key Please note that using the TAB key (automatic-command-completion) will automatically use escapes for spaces (so you don't have to type them manually). script scriptThe “script” command commandcreates a typescript,typescript or "capture log" of a shell shellsession - it writes writesa copy copyof your session sessionto a file,file including includingcommands commandsyou type and their output.output~ (tilde character) ~The tilde tildecharacter characteris used as an alias aliasto a users usershomehome directory.directory For example,example if your user-name user-namewas “fred”, instead of typing cd cd/home/fred you could simply type cd cd~. Or to get to fred's tmp tmpdirectory directory(under his home homedirectory) you could type cd cd~/tmp. Home directory shortcut ~ (tilde) can also be used as a shortcut to other users home directories, simply type: ~user_name and it will take you to the user's home directory. Note that you need to spell the username exactly correct, no wildcards.  set bell-style  none set bell styleThis particular particularset command commandwill turn turnoff offthe system systembell from the commandline commandline(use xset xset-b for X windows). If you want the bell bellto stay off offpernamently (no audible audiblebell) then you can add addthis command commandto your “.bashrc” or “.bash_profile” (just add it to the same one you have your alises in...). reset resetThe reset command commandre-initializes your current currentterminal.terminal This can be useful when the text textfrom your terminal's text textbecomes garbled,garbled simply type “reset” and this will fix fixyour terminal.terminal exit exitCloses your current currentterminal terminal(with x-terminals) or logs-out.logs-out Also try try CTRL D CTRL-D . logout logoutLogs out of a terminal,terminal also try try CTRL D CTRL-D . echo echoA little command commandthat repeats repeatsanything you type.Example:Simply displays “ hello helloworldworld”. Example:This will output outputwhat will be passed passedto the rm command command(and therefore what would be deleted), putting puttingecho before a command renders rendersit harmless harmless(it just expands expandswildcards wildcardsso you know what it will do).Also try tryusing the -e -e option optionwith echo.echo This will allow allowyou to use the escape escapecharacter charactersequences to format formatthe output outputof a line.line Such as '\t' for tab,tab '\n' for newline newlineetc. Using echo to prevent accidents Typing: echo command(s) could save you the trouble of accidentally doing something you didn't expect. Using echo allows you to expand the wildcards to understand what will happen before you actually run the command. The command-line historyUsing the command  history historyUse the up and down key's to scroll scrollthrough previously typed commands.commands Press Press[Enter] to execute executethem or use the left leftand right arrow arrowkeys to editedit the command commandfirst. Also see history (below).The history  command commandThe history history command commandcan be used to list listBash's log logof the commands commandsyou have typed:This log logis called the “history”. To access accessit type:This will only list listthe last lastn commands.commands Type “history” (without options) to see the the entire entirehistory list.listYou can also type !n to execute executecommand commandnumber n. Use !! to execute executethe last lastcommand you typed.!-n will execute executethe command commandn times timesbefore (ie. !-1 is equivalent equivalentto !!). !string will execute executethe last lastcommand starting startingwith that “string” and !?string? will execute executethe last lastcommand containing the word word“string”. For example:exampleWill re-run the command commandthat you last lasttyped starting startingwith “cd”.“ commandName commandName!*” will execute executethe “commandName” with any arguments argumentsyou used on your last lastcommand. This maybe useful if you make a spelling spellingmistake, for example.example If you typed:In an attempt attemptto execute executeemacs emacson the above two files filesthis will obviously fail.fail So what you can do is type:This will execute executeemacs emacswith the arguments argumentsthat you last lasttyped on the commandcommand line.line In other words wordsthis is equivalent equivalentto typing:Searching through the Command History ( CTRL R CTRL-R ) Use the CTRL-R key keyto performperform a “reverse-i-search”. For example,example if you wanted to use the command commandyou used the last lasttime you used snort, you would type: CTRL R then type “snort”. What you will see in the console consolewindow windowis:romanAfter you have typed what you are looking lookingfor, use the default CTRL R CTRL-R key keycombination to scroll scrollbackward through the history.history romanUse default CTRL R CTRL-R repeatedlyrepeatedlyroman to find finddefaulteveryroman reference referenceto the string stringyou've entered.entered Once you've found foundthe command commandyou're looking lookingfordefault,roman use [Enter] to execute executeit. Alternatively, romanusing the right or left leftarrow keys keyswill place placethe command commandon an actual actualcommand line lineso you can default edit editit. Other Key combinationsGNU/Linux shells shellshave many shortcut shortcutkeys which whichyou can use to speed speedup your work,work below is a rough roughlist of some (also see CTRL-R the history historysectionsection of the commands,commands over here, ). The CTRLD the “end-of-file” (EOF) key combination can be used to quickly log out of any terminal. CTRL-D is also used in programs such as “at” to signal that you have finished typing your commands (the EOF command). The CTRLZ key combination is used to stop a process. It can be used to put something in the background temporarily. For example, if you were editing a file with vim or emacs just press CTRL-Z to regain control of the terminal do what you want and then type fg to bring it back. For further information please see . If <emphasis>fg</emphasis> doesn't work If fg doesn't work you may need to type jobs and then fg job_name or fg job_number The CTRLA and CTRLE key combinations are used for going to the start and end of the line on the command line. Use CTRLA to jump to the start of the line, and CTRLE to jump to the end of the line. The CTRLK key combination can be used to cut or delete what is currently in front of the cursor. The CTRLY key combination can be used to paste the last thing you deleted (using CTRL K CTRL-K or CTRL W CTRL-W ). The CTRLW key combination can be used to cut or delete the entire line that has being typed. Virtual Terminals and screenUsing the key combination ALT F* keys you may change to different virtual terminals. You will have several (usually 6) virtual terminals setup with shells. Number 7 is usually setup with X you need to use CTRL ALT F* CTRL-ALT-F* to change to a terminal from within X (X as in the X windowing system). screen screenis a great greatprogram that allows allowsyou to switch switchbetween multiple multiplevirtualvirtual terminals terminalson the one physical physicalterminal terminalthat you are using. Its a command-line command-linebased window windowmanager, clearly this isn't that useful if you do have virtual virtualterminals, but its amazingly useful when you loglog into machines machinesremotely, using ssh sshand similar,similar see . It works workson key-combinations,key-combinations you typeOn the command-line to begin. Now you start with one virtual terminal by default, but using the key combination CTRL A and then hitting "C" you can create another virtual terminal to use. Use CTRLN to go to the next virtual terminal and CTRLP to go to the previous virtual terminal. Also try hitting CTRLA to go backwards and forwards between two particular terminals. screen screenalso has various other abilities abilitiesthat you can test testout. The documentation documentationand guides are well written writtenso please feel free freeto readread the manual manualpage pageor try trysearching the internet.internet HelpThe help helpchapter provides providesinformation informationon how you may access accessthe documentationdocumentation of the GNU/Linux system.system There is normally a document documentdescribing every single tool toolyou have installed,installed even if its only brief... man manThis command commanddisplays summary summaryinformation informationon a program programfrom an onlineonline manual.manual For example exampletyping man man manwill bring up the manual manualpage pagefor man man(the manual manualpage pageviewer). Note: q is the quit quitkey. Command Commandsyntax: Also try Specifying the section of the manual page, sometimes the man page is different for the same tool in different sections, note sections are numbered 1 to 9. Use apropos to find which section number to look in. The syntax to look at a different section is: man section_number tool_name For example: man 2 time This will show you the man page called time in section 2, the equivalent page in section 1 is completely different man -K  keyword keywordSearch Searchthe manual manualpages for a string,string as in it will searchsearch all manual manualpages for a particular particularstring stringwithin each individual individualman manpage,page it will then prompt promptwhether you would like to view vieweach page pageit will find.find Use double doublequotes “ and ” if there are spaces spacesin the string stringyou are typing. Speed issue Please be warned that this method is going to be really, really slow. You are searching *all* man pages for a string man -f  command commandThis will list listdetails detailsassociated associatedwith the command. The root rootuser usermust run runmakewhatis (see below) before this command commandwill work.work Equivalent to <emphasis>whatis</emphasis> This command is the same as running whatis info infoProvides a more moredetailed detailedhyper-text manual manualon a particular particularcommand,command this only works worksfor some commands.commands Command Commandsyntax: whatis whatisDisplays a one line linedescription descriptionof what a program programdoes. The string stringneeds to be an exact exactmatch, otherwise whatis won't output outputanything. Relies on the whatis whatisdatabase (see below). Command Commandsyntax: makewhatis makewhatisMake the whatis whatisdatabase for apropos, whatis and man man-f.-f Root Privileges This takes some time and you require root privileges to do this. apropos aproposSearches Searchesthe whatis whatisdatabase for strings,strings similar similarto whatis except it finds findsand prints printsanything matching matchingthe string string(or any part partof the string). Also relies on the whatis whatisdatabase (see above). Command Commandsyntax: Equivalent to... apropos is the same as doing man -k (lowercase k). Please note You need to run makewhatis (as root) so whatis, man -f and apropos will work. Also try Using a program with the -?, --h, --help, and the -h options, they will display very short summary information on the command usage options. Directing Input/OutputThe directing input/output chapter explains explainshow you can use a program programand send sendits output outputto a file fileor to another command commandthat you wish to use. This technique techniqueis very powerful powerfuland there are a number numberof ways of doing this.Concept DefinitionsAll three of the following followingdefinitions definitionsare called “ File FileStreams.Streams” They hold information informationthat is either received receivedfrom somewhere or sent to somewhere. In a UNIX UNIXsystem,system the keyboard keyboardinput (standard input), information informationprinted to the screen screen(standard output) and error erroroutput output(also printed printedto the screen) are treated treatedas separate separateFile Streams.StreamsStandard output Standard standard outputoutput output, standardis the output outputfrom the program programprinted printedto the screen,screen not including includingerror output output(see below).Standard input Standard standard inputinput input, standardis the input inputfrom the user.user Normally the keyboard keyboardis used as the standard standardinput inputstandard inputdevice in a UNIX UNIXsystem.systemStandard error Standard Standarderror erroris error erroroutput outputfrom programs.programs This output outputis also sent to the screen screenand will normally be seen mixedmixed in with standard standardoutput.standard outputoutput The difference differencebetween standard standardoutput standard outputoutputand standard standarderror standard erroris that standard error erroris unbuffered unbuffered(it appears immediately on the screen) and standardstandard error erroris only printed printedwhen something goes wrong wrong(it will give you detailsdetails of what went wrong). Usage> >The greater greaterthan symbol symbolis used to send sendinformation informationsomewhere (for exampleexample a text textfile)Example: file1_and_2.txt ]]>This will concatenate concatenatethe files filestogether into one big file filenamed named“file1_and_2.txt”. Note that this will overwrite overwriteany existing existingfile.< <The less lessthan symbol symbolwill insert insertinformation informationfrom somewhere (a text textfile) as if you typed it yourself. Often used with commands commandsthat are designed designedto get information informationfrom standardstandard input inputonly.For example example(using tr): fileNameNew.txt ]]>The example exampleabove would insert insertthe contents contentsof “fileName.txt” into the input inputof tr and output outputthe results resultsto “fileNameNew.txt”.>> >>The >> symbol symbolappends (adds) information informationto the end endof a file fileor creates one if the file filedoesn't exist.exist<< <<The << symbol symbolis sometimes used with commands commandsthat use standard standardinputinputstandard input to take takeinformation.information You simply type << wordword (where word wordcan be any string) at the end endof the command.command The command commandtakes your input inputuntil untilyou type “word”, which whichcauses the command commandto terminate terminateand process processthe input.input Using << is an alternative alternativeto using CTRL D CTRL-D (EOF key), except it uses a string stringto perform performthe end-of-file end-of-filefunction.functionFor example type "cat" (with no options...) and it will work workon standard standardinput.inputstandard inputTo stop stopentering standard standardinput inputstandard inputyou would normally hit hit CTRL D CTRL-D .As an alternative alternativeyou can type "cat << FINISHED", then type what you want. When you are finished,finished instead of hitting hitting CTRL D CTRL-D you could type "FINISHED"FINISHED and it will end end(the word wordFINISHED will not be recorded).2> 2>Redirects error erroroutput.output For example,example to redirect redirectthe error erroroutput outputto /dev/null, so you do not see it, simply append this to the end of another command...For example:example /dev/null ]]> Runs Runsmake on a file fileand send sendall error erroroutput outputto /dev/null| |The “pipe” pipecommand commandallows allowsthe output outputof one command commandto be sent to the input inputof another.For example:example Concatenates Concatenatesthe files filestogether, then runs runsless on them. If you are only going to look lookat a single file,file you would simply use less on the file... tee teeSends Sendsoutput of a program programto a file fileand to standard standardoutput.standard outputoutput Think of it as a sansTdefault intersection...it goes two ways.For example:example Lists Liststhe files files(displays the output outputon the screen) and sends sendsthe output to a file:file “my_directories.txt”.&> &>Redirects Redirectsstandard output, standardoutput standard outputoutputand error erroroutput output, errorto a specific specificlocation.locationFor example:example /dev/null ]]> Sends Sendsboth error erroroutput outputand standard standardoutput standard outputoutputto /dev/null so you won't see anything... Command SubstitutionCommand Commandsubstitutionsubstitution, commandcommand substitution is basically basicallyanother way to do a pipe,pipe you can use pipes pipesand command commandsubstitution interchangeably,interchangeably it's up to you which whichone you find easier... Command Commandsubstitution can be done in two distinct distinctways.  Method One (back-quotes)  Simply type:This will execute execute“command_2” and it's output outputwill become the input inputto “command_1”. Backquote key The back-quote key is usually located at the same pla