Table Of Content82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page iii
SUSE®Linux®
TOOLBOX
1000+ Commands for openSUSE
and SUSE Linux Enterprise
Christopher Negus
François Caen
Wiley Publishing, Inc.
82928ffirs.qxd:Toolbox 11/1/07 12:40 PM Page iv
SUSE® Linux® Toolbox:
1000+ Commands for openSUSE and SUSE Linux Enterprise
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-08292-8
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data is available from the publisher.
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 either the prior written permission of the
Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center,
222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permis-
sion should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis,
IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.
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 pro-
fessional person should be sought. Neither the publisher nor the author shall be liable for damages arising here-
from. 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 United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks:Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc.
and/or its affiliates, in the United States and other countries, and may not be used without written permission.
SUSE and openSUSE are registered trademarks of Novell, Inc. Linux is a registered trademark of Linus Torvalds.
All other trademarks are the property of their respective owners. Wiley Publishing, Inc. is not associated with
any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be
available in electronic books.
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page v
As always, I dedicate my work on this book to my wife, Sheree.
—Christopher Negus
I dedicate this book to the UnderLUG crew.
—François Caen
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page vi
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page vii
About the Authors
Christopher Negus is the author of the best-selling Fedora and Red Hat Linux Bibles,
Linux Toys, Linux Troubleshooting Bible, and Linux Bible 2007 Edition. He is a member of
the Madison Linux Users Group. Prior to becoming a full-time writer, Chris served
for eight years on development teams for the Unix operating system at AT&T, where
Unix was created and developed. He also worked with Novell on Unix development
and Caldera Linux.
François Caen, through his company Turbosphere LLC, hosts and manages business
application infrastructures, with 95 percent running on Linux systems. As an open
source advocate, he has lectured on OSS network management and Internet services,
and served as president of the Tacoma Linux User Group. François is a Red Hat
Certified Engineer (RHCE). In his spare time, François enjoys managing enterprise
Cisco networks.
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page viii
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page ix
Credits
Acquisitions Editor Vice President and Executive Publisher
Jenny Watson Joseph B. Wikert
Development Editor Project Coordinator, Cover
Sara Shlaer Lynsey Osborn
Technical Editor Compositor
Thomas Blader Laurie Stewart,
Happenstance Type-O-Rama
Copy Editor
Michael Koch Proofreader
Kathryn Duggan
Editorial Manager
Mary Beth Wakefield Indexer
Melanie Belkin
Production Manager
Tim Tate Anniversary Logo Design
Richard Pacifico
Vice President and
Executive Group Publisher
Richard Swadley
82928ffirs.qxd:Toolbox 11/1/07 12:31 PM Page x
Contents at a Glance
Chapter 1: Starting with SUSE . . . . . . . . . . . . . . . . . . . . . . . . .1
Chapter 2: Installing openSUSE and Adding Software . . . . . . . .11
Chapter 3: Using the Shell . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Chapter 4: Working with Files . . . . . . . . . . . . . . . . . . . . . . . . .59
Chapter 5: Manipulating Text . . . . . . . . . . . . . . . . . . . . . . . . . .79
Chapter 6: Playing with Multimedia . . . . . . . . . . . . . . . . . . . . .97
Chapter 7: Administering File Systems . . . . . . . . . . . . . . . . . .111
Chapter 8: Backups and Removable Media . . . . . . . . . . . . . . .139
Chapter 9: Checking and Managing Running Processes . . . . . .155
Chapter 10: Managing the System . . . . . . . . . . . . . . . . . . . . .173
Chapter 11: Managing Network Connections . . . . . . . . . . . . .195
Chapter 12: Accessing Network Resources . . . . . . . . . . . . . . .215
Chapter 13: Doing Remote System Administration . . . . . . . . .235
Chapter 14: Locking Down Security . . . . . . . . . . . . . . . . . . . .251
Appendix A: Using vi or Vim Editors . . . . . . . . . . . . . . . . . . . .265
Appendix B: Shell Special Characters and Variables . . . . . . . .273
Appendix C: Getting Information from /proc . . . . . . . . . . . . . .277
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .283
82928ftoc.qxd:Toolbox 11/1/07 12:32 PM Page xi
Contents
Acknowledgments xix
Introduction xxi
Chapter 1: Starting with SUSE 1
About SUSE, Novell, and Linux 2
Comparing SUSE to Other Linux Versions 2
Finding SUSE Resources 3
Focusing on Linux Commands 4
Finding Commands 5
Command Reference Information in SUSE 6
Summary 10
Chapter 2: Installing openSUSE and Adding Software 11
Installing openSUSE 11
Preparing to Install 12
Choosing Installation Options 12
Answering Installation Questions 15
Working with Software Packages 18
Getting Software Packages with YaST 19
Adding and Updating Software with YaST 20
Using zypper to Manage Software 23
Working with zypper Repositories 24
Searching for Software with zypper 27
Installing and Removing Software with zypper 31
Managing Software with RPM 33
Installing a Package with rpm 34
Upgrading a Package with rpm 34
Removing a Package with rpm 35
Querying Information about RPM Packages 35
Verifying Installed Packages with rpm 38
Building RPMs from SRPMs 39
Extracting Files from RPMs 40
Summary 40