Transcription of Sams’ Teach Yourself LINUX
1 Sams Teach YourselfLINUXin 24 HoursTeach Yourself LINUX in 24 HoursiiBill BallStephen Smoogen Sams Teach YourselfLINUXin 24 Hours201 West 103rd StreetIndianapolis, Indiana 46290 Teach Yourself LINUX in 24 HoursivPublisherDon FowleyExecutive EditorJeff KochManaging EditorSarah KearnsTo Cathy and Nat for their kindness, love, and warm fuzzies. Bill BallCopyright 1998 by Sams Publishing andRed Hat PressFIRST EDITIONAll rights reserved. No part of this book shall be reproduced, stored in aretrieval system, or transmitted by any means, electronic, mechanical, photo-copying, recording, or otherwise, without written permission from thepublisher.
2 No patent liability is assumed with respect to the use of theinformation contained herein. Although every precaution has been taken in thepreparation of this book, the publisher and author assume no responsibility forerrors or omissions. Neither is any liability assumed for damages resulting fromthe use of the information contained herein. For information, address SamsPublishing, 201 W. 103rd St., Indianapolis, IN Standard Book Number: 0-672-31162-3 Library of Congress Catalog Card Number: 97-6800501 00 99 984 3 2 1 Interpretation of the printing code: the rightmost multi-digit number is theyear of the book s printing; the rightmost single-digit, the number of the book sprinting.
3 For example, a printing code of 98-1 shows that the first printing ofthe book occurred in in AGaramond and MCPdigital by Macmillan Computer PublishingPrinted in the United States of AmericaAll terms mentioned in this book that are known to be trademarks or servicemarks have been appropriately capitalized. Sams Publishing cannot attest to theaccuracy of this information. Use of a term in this book should not be regardedas affecting the validity of any trademark or service mark. Red Hat is atrademark of Red Hat Software, EditorKim SpilkerDevelopment EditorMark CierzniakTechnical EditorSteve BurnettProject EditorsAndrew CuppColleen WilliamsCopy EditorsMargaret BersonHoward JonesSoftware SpecialistJack BelbotTeam CoordinatorTracy WilliamsCover DesignerJay CorpusBook DesignerGary AdairProduction TeamMike HenryLinda KnoseTim OsbornStaci SomersMark WalchleIndexerChris WilcoxOverviewIntroductionxxviPart IInstallation and Configuration1 Hour 1 Preparing to Install Linux32 Installing Linux113 Configuring the X Window System31 Part IILearning LINUX Basics4 1 Hour 4 Reading and Navigation
4 Commands435 Manipulation and Searching Commands636 Using the Shell837 Using the X Window System1038 Exploring Other X11 Window Managers127 Part IIIC onnecting to the Outside World1 3 9 Hour 9 Using Communications Programs14110 Connecting to the Internet16111 Configuring Internet Email17312 Configuring Internet News18513 Internet Downloading and Browsing193 Part IVUsing LINUX Productively211 Hour 14 Text Processing21315 Preparing Documents22916 Graphics Tools24317 Learning Math and Financial Tools25918 Personal Productivity Tools27119 Playing LINUX Games281 Teach Yourself LINUX in 24 HoursviPart VAdministering Your System291 Hour 20 Basic System Administration29321 Handling Files31322 Red Hat Tools32923 Archiving33924 Scheduling347 Index353 ContentsIntroductionxxviPart IInstallation and Configuration1 Hour 1 Preparing to Install Linux3 Taking Inventory.
5 4 Hardware Considerations .. 6 Network Information .. 6 Creating the Installation Floppies .. 7 Preparing Your Hard Drive .. 7 Partitions and File Systems .. 7 Creating Space .. 92 Installing Linux11 The Installation Program s Interface .. 11 Beginning the Installation .. 12 The First Stage .. 13 Keyboard Selection .. 14 PCMCIA Support .. 15 Installation Method .. 15 Installing from CD-ROM .. 16 The Second Stage .. 17 Selecting to Install Fresh or Upgrade .. 17 SCSI Support .. 17 Partitioning the Hard Drive .. 17 Activating Swap Space .. 22 Formatting Partitions .. 22 Selecting Which Components To Install.
6 22 Format and Install .. 23 Finishing the Installation .. 23 Choosing a Mouse .. 24 Configuring X Window .. 24 Network Configuration .. 24 Setting the Time Zone .. 25 Selecting Which Services to Start .. 25 Selecting a Printer .. 26 Entering Your Initial Password .. 27 Selecting Boot Options .. 28 Booting the System .. 293 Configuring the X Window System31 Checking Your Installation Files .. 32 Installing the X Files .. 33 Teach Yourself LINUX in 24 HoursviiiUsing Xconfigurator to Set Up X Window .. 34 Selecting Your Monitor .. 35 Final Server Configuration .. 36 Testing the X Settings.
7 37 Common Problems and Their Solutions .. 38 Having Your Machine Always Start in X Window .. 39 Part IILearning LINUX Basics4 1 Hour 4 Reading and Navigation Commands43 Getting Help with the man Command .. 43 Navigating and Searching the File System .. 46 Moving to Different Directories with the cd Command .. 46 Knowing Where You Are with the pwd Command .. 46 Searching Directories for Matching Files with the find Command .. 47 Finding Files with the whereis Command .. 48 Locating Files with the locate Command .. 48 Getting Command Summaries with whatis and 49 Reading Directories and Files.
8 51 Listing Directories with the ls Command .. 51 Listing Directories with the dir and vdir Commands .. 54 Graphic Directory Listings with the tree Command .. 54 Listing and Combining Files with the cat Command .. 56 Reading Files with the more Command .. 58 Browsing Files with the less Command .. 59 Reading the Beginning or End of Files with the head and tailCommands .. 595 Manipulation and Searching Commands63 Manipulating Files or Directories .. 63 Creating Files with the touch Command .. 64 Deleting Files with the rm Command .. 64 Creating Directories with the mkdir Command .. 66 Removing Directories with the rmdir Command.
9 66 Renaming Files with the mv Command .. 68 Copying with the cp Command .. 69 Creating Hard and Symbolic Linkswith the ln Command .. 71 Handling Files with the Midnight Commander Program .. 72 Searching Files .. 73 What Are Regular Expressions? .. 74 Searching Inside Files with the grep Commands .. 75 Compressing and Uncompressing Files .. 77 Creating Archives with the Tape Archive Command .. 77 Creating cpio Archives .. 80 Compressing Files with the gzip Command .. 80 Compressing Files with the compress Command .. 816 Using the Shell83 What Is a Shell? .. 83 What Shells Are Available?
10 84 Features of ash .. 85 Features of the Default LINUX Shell bash .. 85 The Public Domain Korn Shell ksh .. 86 Features of the csh-Compatible Shell tcsh .. 87zsh .. 87 Understanding the Shell Command Line .. 88 Customizing Your Shell .. 90 Running Programs in the Background .. 94 How to Use Pipes .. 96 Building Shell Commands .. 987 Using the X Window System103X11 Window Managers .. 104 Configuring the fvwm2 Window Manager .. 104 Configuring the fvwm Window Manager .. 108 Configuring the twm Window Manager .. 109X11 Terminal Programs .. 110 Changing the nxterm Terminal Settings .. 110 Using the Memory-Efficient rxvt Terminal.