Linux All-In-One for Dummies CHAPTER 3: Commanding the Shell
Total Page:16
File Type:pdf, Size:1020Kb
Linux ® ALL-IN-ONE Linux ® ALL-IN-ONE 6th Edition by Emmett Dulaney Linux® All-in-One For Dummies®, 6th Edition Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com Copyright © 2018 by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/ permissions. Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. Linux is a registered trademark of Linus Torvalds. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit https://hub.wiley.com/community/support/dummies. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2018943541 ISBN: 978-1-119-49046-3 (pbk); 978-1-119-49052-4 (ebk); 978-1-119-49045-6 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Contents at a Glance Introduction . 1 Book 1: Getting Started with Linux . 7 CHAPTER 1: Introducing Linux . 9 CHAPTER 2: Installing Linux . 29 CHAPTER 3: Troubleshooting and Configuring Linux . 39 CHAPTER 4: Trying Out Linux . 57 Book 2: Linux Desktops . 67 CHAPTER 1: GNOME and Its Derivatives . 69 CHAPTER 2: The KDE Plasma Desktop . 75 CHAPTER 3: Commanding the Shell . 83 CHAPTER 4: Navigating the Linux File System . 105 CHAPTER 5: Introducing Linux Applications . 123 CHAPTER 6: Using Text Editors . 137 Book 3: Networking . 151 CHAPTER 1: Connecting to the Internet . 153 CHAPTER 2: Setting Up a Local Area Network . 167 CHAPTER 3: Going Wireless . 181 CHAPTER 4: Managing the Network . 191 Book 4: The Internet . 203 CHAPTER 1: Browsing the Web . 205 CHAPTER 2: Using FTP . 217 CHAPTER 3: Hosting Internet Services . 229 CHAPTER 4: Managing Mail Servers . 245 CHAPTER 5: Managing DNS . 259 Book 5: Administration . 281 CHAPTER 1: Introducing Basic System Administration . 283 CHAPTER 2: Managing Users and Groups . 319 CHAPTER 3: Managing File Systems . 331 CHAPTER 4: Working with Samba and NFS . 353 Book 6: Security . 363 CHAPTER 1: Introducing Linux Security . 365 CHAPTER 2: Securing Linux . 381 CHAPTER 3: Vulnerability Testing and Computer Security Audits . 413 Book 7: Scripting . 429 CHAPTER 1: Introductory Shell Scripting . 431 CHAPTER 2: Working with Advanced Shell Scripting . 443 CHAPTER 3: Programming in Linux . 451 Book 8: Linux Certification . .. 477 CHAPTER 1: Studying for the Linux Essentials Certification Exam . 479 CHAPTER 2: Studying for the CompTIA Linux+ Powered by LPI Certification Exams . 489 CHAPTER 3: Other Linux Certifications . 507 Index . 509 Table of Contents INTRODUCTION . 1 About This Book . 2 Foolish Assumptions . .. 3 Icons Used in This Book . 4 Beyond the Book . 4 Where to Go from Here . 5 BOOK 1: GETTING STARTED WITH LINUX . 7 CHAPTER 1: Introducing Linux . 9 What Is Linux? . 9 Linux distributions . 10 Making sense of version numbers . 13 Linux Standard Base (LSB) . 14 Contents of a Linux Distribution . 15 GNU software . 15 GUIs and applications . 16 Networks . 19 Internet servers . 19 Software development . 20 Online documentation . 22 Managing Your PC with Linux . 23 Distribution media . .23 Peripheral devices . 24 File systems and sharing . 25 Network . 25 Getting Started . 26 Step 1: Install . 26 Step 2: Configure . 26 Step 3: Explore . 27 Step 4: Find out more . 27 CHAPTER 2: Installing Linux . 29 Following the Installation Steps . 29 Checking Your PC’s Hardware . 31 Setting Aside Space for Linux . 33 Trying a Live CD . 34 Installing Linux on a Flash Drive . 35 Creating the bootable flash drive . 35 Troubleshooting the workstation . 36 Working daily with the new drive . 37 Table of Contents vii CHAPTER 3: Troubleshooting and Configuring Linux . 39 Using Text Mode Installation . 40 Troubleshooting X . 40 Resolving Other Installation Problems . .. 42 Using Knoppix boot commands . 42 Handling the fatal signal 11 error . 45 Getting around the PC reboot problem . 45 Using Linux kernel boot options . 48 Setting Up Printers . 48 Managing DVDs, CD-ROMs, and Flash Drives . 51 Installing Other Software . 51 Installing software in Debian and Ubuntu . 52 Installing software in Fedora . 54 Installing software in SUSE . 55 CHAPTER 4: Trying Out Linux . 57 Starting Linux . 57 Playing with the Shell . 60 Starting the bash shell . 61 Understanding shell commands . 62 Trying a few Linux commands . .. 62 Shutting Down . 64 BOOK 2: LINUX DESKTOPS . 67 CHAPTER 1: GNOME and Its Derivatives . 69 Getting to Know the GNOME Desktop . 70 Understanding the GNOME Panels . .72 The top panel . 72 The desktop . 72 The bottom panel . 73 Looking at Unity . 73 Looking at Cinnamon . 73 Looking at MATE . 74 CHAPTER 2: The KDE Plasma Desktop . 75 Getting to Know the Plasma Desktop . 75 Desktop contextual menus . 77 Icon contextual menus . 77 Understanding the Plasma Panel . 78 The Main Menu button . .. 79 Panel icons . 80 Configuring the Plasma Bottom Panel . 81 Configuring the Plasma Desktop.