Fundamentals of Linux
Total Page:16
File Type:pdf, Size:1020Kb
Fundamentals of Linux Student Workbook Fundamentals of Linux Fundamentals of Linux Jeff Howell Published by ITCourseware, LLC., 7245 South Havana Street, Suite 100, Centennial, CO 80112 Contributing Authors: Mark Copley, Rob Roselius Editor: Rick Sussenbach Assistant Editor: Jan Waleri Special thanks to: Many instructors whose ideas and careful review have contributed to the quality of this workbook, including Larry Burley and Richard Raab, and the many students who have offered comments, suggestions, criticisms, and insights. Copyright © 2008 by ITCourseware, LLC. All rights reserved. No part of this book may be reproduced or utilized in any form or by any means, electronic or mechanical, including photo-copying, recording, or by an information storage retrieval system, without permission in writing from the publisher. Inquiries should be addressed to ITCourseware, LLC., 7245 South Havana Street, Suite 100, Centennial, Colorado, 80112. (303) 302-5280. All brand names, product names, trademarks, and registered trademarks are the property of their respective owners. Page ii Rev 3.1.2 © 2008 ITCourseware, LLC Fundamentals of Linux Contents Chapter 1 - Course Introduction ........................................................................................................... 11 Course Objectives .......................................................................................................................... 12 Course Overview ........................................................................................................................... 14 Using the Workbook ...................................................................................................................... 15 Suggested References ..................................................................................................................... 16 Chapter 2 - Getting Started ................................................................................................................... 19 What is UNIX? .............................................................................................................................. 20 A Brief History of UNIX ................................................................................................................. 22 Linux .............................................................................................................................................. 24 The Toolkit Philosophy ................................................................................................................... 26 Linux Distributions .......................................................................................................................... 28 Free Software and Open Source Movements .................................................................................. 30 Logging In ...................................................................................................................................... 32 Logging Out ................................................................................................................................... 34 Try a Few More Commands ........................................................................................................... 36 Changing Your Password ................................................................................................................ 38 Online Documentation - man Pages ................................................................................................. 40 Online Documentation - info Pages .................................................................................................. 42 Labs ............................................................................................................................................... 44 Chapter 3 - The File System - Files ....................................................................................................... 47 What is a File? ................................................................................................................................48 The ls Command ............................................................................................................................ 50 The cat Command .......................................................................................................................... 52 The more and less Commands ........................................................................................................ 54 The head and tail Commands .......................................................................................................... 56 Copy, Rename, and Delete: cp, mv, rm ............................................................................................ 58 File Names ..................................................................................................................................... 60 Working with MS-DOS disks: mtools ............................................................................................. 62 Labs ............................................................................................................................................... 64 © 2008 ITCourseware, LLC Rev 3.1.2 Page iii Fundamentals of Linux Chapter 4 - The File System - Directories ............................................................................................. 67 Hierarchical File System .................................................................................................................. 68 Pathnames ...................................................................................................................................... 70 pwd and cd - Navigating Directories ............................................................................................... 72 mkdir and rmdir - Managing Directories .......................................................................................... 74 The cp Command (again) - Copy Files ............................................................................................ 76 Two Useful Directory Names - . and .. ............................................................................................ 78 Labs ............................................................................................................................................... 80 Chapter 5 - Text Editors ....................................................................................................................... 83 Linux Text Editors ........................................................................................................................... 84 The pico Editor ............................................................................................................................... 86 The Nedit Editor ............................................................................................................................. 88 The Emacs Text Editor .................................................................................................................... 90 The vi Text Editor Family ................................................................................................................ 92 Labs ............................................................................................................................................... 94 Chapter 6 - Editing With vi .................................................................................................................... 97 What is vi? ..................................................................................................................................... 98 Getting Started - vi Buffering ......................................................................................................... 100 Command Mode and Insert Mode ................................................................................................ 102 Getting Started ............................................................................................................................. 104 Moving the Cursor Around ........................................................................................................... 106 Inserting Text ................................................................................................................................ 108 Deleting a Character or Line ......................................................................................................... 110 Undo Last Command ................................................................................................................... 112 Opening a New Line ..................................................................................................................... 114 Save Your Work or Abort the Session ........................................................................................... 116 Review of vi Commands ............................................................................................................... 118 Labs ............................................................................................................................................. 120 Chapter 7 - Personal Utilities .............................................................................................................. 123 The date Utility ............................................................................................................................