ebook img

Sams teach yourself Unix in 10 minutes PDF

257 Pages·2005·2.926 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Sams teach yourself Unix in 10 minutes

Teach Yourself Unix 10 in Minutes Robert Shimonski 800 East 96th Street, Indianapolis, Indiana, 46240 USA Sams Teach Yourself Unix ACQUISITIONSEDITOR Jenny Watson in 10 Minutes DEVELOPMENTEDITOR Scott Meyers Copyright © 2005 by Sams Publishing All rights reserved. No part of this book shall be reproduced, MANAGINGEDITOR stored in a retrieval system,or transmitted by any means, Charlotte Clapp electronic,mechanical,photocopying,recording,or otherwise, without written permission from the publisher. No patent lia- PROJECTEDITOR bility is assumed with respect to the use of the information Mandie Frank contained herein. Although every precaution has been taken in the preparation of this book,the publisher and author assume COPYEDITOR no responsibility for errors or omissions. Nor is any liability Laura Town assumed for damages resulting from the use of the informa- tion contained herein. INDEXER International Standard Book Number:0-672-32764-3 Tim Wright Library of Congress Catalog Card Number:2004098030 Printed in the United States of America TECHNICALEDITOR Christopher Heinz First Printing:June 2005 08 07 06 05 4 3 2 1 PUBLISHING COORDINATOR Trademarks Vanessa Evans All terms mentioned in this book that are known to be trade- marks or service marks have been appropriately capitalized. INTERIORDESIGNER Sams Publishing cannot attest to the accuracy of this informa- Gary Adair tion. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. COVERDESIGNER Aren Howell Warning and Disclaimer Every effort has been made to make this book as complete PAGELAYOUT and as accurate as possible,but no warranty or fitness is Brad Chinn implied. The information provided is on an “as is”basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book. Bulk Sales Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information,please contact U.S. Corporate and Government Sales 1-800-382-3419 [email protected] For sales outside of the U.S.,please contact International Sales [email protected] Contents at a Glance Part I Learning the Unix Environment:Baby Steps Lesson 1 Getting Started 1 Lesson 2 Getting Help 16 Lesson 3 Interfacing with Unix Graphically 29 Part II Navigating the Unix File System Lesson 4 The File System Explained 47 Lesson 5 File System Navigation Techniques 66 Part III File System Utilities Lesson 6 Working with the Shell 76 Lesson 7 Reading Files 93 Lesson 8 Text Editing 102 Lesson 9 Text and File Utilities 114 Lesson 10 Compression and Archiving Tools 125 Part IV Working with the Shell Lesson 11 Managing Processes in Unix 137 Lesson 12 Input and Output 150 Lesson 13 Regular Expressions 158 Lesson 14 Shell Scripting Fundamentals 166 Part V Environment Customization Lesson 15 User Utilities 175 Lesson 16 Modifying Your Environment 186 Part VI Networking and Communications Lesson 17 Printing with Unix 194 Lesson 18 Networking and Security 201 Part VII Tips and Tricks Lesson 19 Configuring Permissions in Unix 209 Lesson 20 Unix Privileged Commands 219 Part VIII Appendix Appendix A Learn More About Unix:Reference 226 Index 229 Contents Introduction........................................................................................xi Part I Learning the Unix Environment: Baby Steps 1 Getting Started 1 Practicing with Unix:It Really Does Make You Perfect! ..................2 Prepare to Log In ................................................................................3 The Login Process ..............................................................................5 The Logout Process ............................................................................8 Shell Game ........................................................................................10 Working Within the Shell ................................................................13 Summary ..........................................................................................15 2 Getting Help 16 Finding Help in Unix ........................................................................17 Using the Unix Man Pages ..............................................................18 More Help ........................................................................................21 Even More Help! ..............................................................................24 Graphical Help (Using KDE) ..........................................................25 Additional Documentation ................................................................25 Summary ..........................................................................................27 3 Interfacing with Unix Graphically 29 Overview of the X Window System ................................................29 How Many Windows Are There? ....................................................30 X Window System Functionality ......................................................30 Window Placement ..........................................................................36 X Window System Look and Feel ....................................................38 Window Managers ............................................................................40 Desktop Environments ......................................................................43 Summary ..........................................................................................45 Part II Navigating the Unix File System 4 The File System Explained 47 File System Design ..........................................................................47 Navigating the File System ..............................................................50 Navigating the File System with the GUI ........................................62 Summary ..........................................................................................64 5 File System Navigation Techniques 66 Using the findCommand ................................................................66 Finding Data with Other Unix Commands ......................................70 ThegrepCommand ..........................................................................71 Using the KDE Find Feature ............................................................72 Summary ..........................................................................................74 Part III File System Utilities 6 Working with the Shell 76 Working with Files at the Unix Shell Prompt ..................................77 Summary ..........................................................................................91 7 Reading Files 93 ThecatCommand ............................................................................93 Making Output Readable with Pagers ..............................................96 ThetailCommand ..........................................................................99 Summary ........................................................................................101 8 Text Editing 102 Text Editing with Unix ..................................................................103 TheviEditor ..................................................................................103 TheemacsEditor ............................................................................107 Desktop Environment Tools:KDE’s Built-in Editor ......................111 Summary ........................................................................................112 vi Sams Teach Yourself Unix in 10 Minutes 9 Text and File Utilities 114 ThewcCommand ............................................................................115 ThesplitCommand ......................................................................116 ThediffandpatchCommands ....................................................117 Tying It All Together:File Management Skills Test ......................119 Summary ........................................................................................123 10 Compression and Archiving Tools 125 Managing Files in Unix ..................................................................125 Managing Your Disk Usage ............................................................126 Compressing Files in Unix ............................................................128 ThetarCommand ..........................................................................132 Usinguuencode/uudecode ..............................................................134 Summary ........................................................................................135 Part IV Working with the Shell 11 Managing Processes in Unix 137 Multitasking ....................................................................................138 ThepsCommand ............................................................................140 ThekillCommand ........................................................................142 TheatandcronCommands ..........................................................143 Summary ........................................................................................148 12 Input and Output 150 I/O Redirection ..............................................................................150 Standard I/O ....................................................................................152 Pipes ................................................................................................155 Summary ........................................................................................156 13 Regular Expressions 158 Pattern Matching and Regular Expressions ....................................158 Using.and* ..................................................................................160 Using[]and^ ................................................................................162 Using^(Again) and $ ....................................................................164 Summary ........................................................................................164 Contents vii 14 Shell Scripting Fundamentals 166 Building Unix Shell Script Files ....................................................170 Usingforeach ................................................................................171 Usingwhileandif ........................................................................173 Summary ........................................................................................174 Part V Environment Customization 15 User Utilities 175 Usingchsh ......................................................................................175 ThepasswdCommand ....................................................................177 Usingfingerandchfn ..................................................................179 Usingdate ......................................................................................182 Usinguptime ..................................................................................183 Usingwho ........................................................................................183 Summary ........................................................................................184 16 Modifying Your Environment 186 Aliases ............................................................................................186 Environment Variables ....................................................................187 Paths ................................................................................................189 Using Dot Files ..............................................................................190 Working with the GUI ....................................................................191 Summary ........................................................................................192 Part VI Networking and Communications 17 Printing with Unix 194 ThelprCommand ..........................................................................195 ThelpqCommand ..........................................................................198 ThelprmCommand ........................................................................199 Summary ........................................................................................200 18 Networking and Security 201 Usingtelnet ..................................................................................202 Usingssh ........................................................................................203 Usingrlogin ..................................................................................204 Usingslogin ..................................................................................206 Usingftp ........................................................................................206 Summary ........................................................................................208 Part VII Tips and Tricks 19 Configuring Permissions in Unix 209 Unix File and Directory Permissions ............................................209 Usingls -l ....................................................................................212 Usingchmod ....................................................................................213 Usingchgrp ....................................................................................217 Summary ........................................................................................218 20 Unix Privileged Commands 219 Root Refresher ..............................................................................219 Single-User Mode ..........................................................................221 fsck ................................................................................................222 shutdown/reboot ............................................................................223 Summary ........................................................................................224 Part VIII Appendix A Learn More About Unix: Reference 226 Index 229 About the Author Robert Shimonski is a well-known networking and security expert con- sulting out of the Long Island,New York area. Rob has authored over 30 books on information technology that include topics specializing in sys- tems engineering with Unix and Microsoft technologies,as well as net- working and security design with Check Point and Cisco technologies. Rob has also deployed state-of-the-art technology in hundreds of compa- nies worldwide—just recently designing and implementing a global MPLS network spanning hundreds of sites. Rob was fortunate to have been able to keep up with his love for Unix by deploying Linux systems and freeware networking and security tools such as Ethereal,NMIS,and MRTG,to name a few. Because of Rob’s unique blend of Unix- and Linux-related real world experience,Rob has served as a technical editor and author on countless Unix- and Linux- related articles and books. Rob was also the networking and security expert chosen to help develop and design LinuxWorld Magazine. You can view LinuxWorld Magazineat http://www.linuxworld.com. To learn more about Roberts’s book projects,please visit him at www.rsnetworks.net. Acknowledgments I would like to thank everyone who helped me create this book—a personal thank you to all who went the extra mile when we needed it most. The editors,thank you very much for giving me the tools I needed to make this book a reality. Jenny Watson,thank you for presenting me with this project and working with me to develop it. My technical editor,Christopher Heinz,and devel- opmental editor,Scott Meyers,for working with me through “crunch time”and being my extra eyes on the printed page.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.