This is a straightforward, easy-to-read, logically organized book about GNU/Linux by an author who has been writing successful books on UNIX/Linux operating systems for more than 20 years. This book is a practical guide because it uses tutorial examples to show you how each command works, each step of the way. Your screen mimics what you see in the book as you learn about GNU/Linux in general and Redhat Linux version 8 in particular.
The book is uniquely designed for both beginners and experienced users, including introductory and more advanced chapters. Although this book targets Red Hat version 8, most of it applies to all GNU/Linux distributions.
Parts I and II of A Practical Guide to Red Hat Linux 8 show you how to
Part III is a reference guide to more than 85 GNU/Linux utilities. Part IV includes appendixes, a glossary, and the index.
You do not have to read this book in page order. Once you are comfortable using GNU/Linux, you can use this book as a reference: Look up a topic of interest in the table of contents or index and read about it. Or think of this book as a catalog of GNU/Linux topics: Flip through the pages until a topic catches your eye. This book has many pointers to Web sites where you can get additional information: Consider the Web as an extension of this book.
Red Hat version 8 release provides users and administrators (who are sometimes one and the same) with tools and an environment that make setting up, maintaining, and using a GNU/Linux system more straightforward than ever before.
Red Hat has wrapped the GNOME and KDE GUIs in its Bluecurve theme, making the two principal graphical desktop environments look and perform similarly. Under Red Hats setup, GNOME runs utilities designed for KDE, and KDE does the same with GNOME utilities. By providing a uniform environment and key tools that work across many platforms, Red Hat is working toward corporate acceptance of desktop GNU/Linux, which benefits all users. For the user who needs to communicate and exchange documents with users on other platforms, Red Hat 8 includes
For the system administrator, Red Hat Linux version 8 provides new configuration tools including
Also, by including the latest software and conforming to the LSB (Linux Standards Base) 1.2, Red Hat helps software developers focus on designing and implementing applications, not dealing with nonconformance issues.
This book appeals to a wide range of readers; it does not require programming experience, but some experience using any general-purpose computer is helpful. This book is appropriate for
A Practical Guide to Red Hat Linux 8 gives you a broad understanding of many facets of GNU/Linux, from using it through customizing it. Whether you are a programmer/developer, a systems administrator, or an end user, this book gives you the knowledge you need to get on with your work: You will come away from this book understanding how to use GNU/Linux, and this book will remain a valuable reference tool for years to come.
A Practical Guide to Red Hat Linux 8 covers a wide range of topics, showing you how to use Red Hat Linux from your screen and keyboard.
Experienced Users May Want to Skim Part I | || tip |
If you have used a UNIX/Linux system before, you may want to skim over or skip some or all of the chapters in Part I. All readers should take a look at Conventions (page 24), which explains the typographic and layout conventions that this book uses, and Documentation (page 42) which points you toward both local and remote sources of GNU/Linux and Red Hat documentation. |
The more advanced material in each chapter is presented in sections marked Optional, which you are encouraged to return to after mastering the basic material presented in the chapter. Review exercises are included at the end of each chapter for readers who want to hone their skills. Some of the exercises test your understanding of material covered in the chapter, whereas others challenge you to go beyond the material presented to develop a more thorough understanding. Answers to some exercises are at www.sobell.com.
Chapter 9 explains what a network is, how it works, and how you can use it. This chapter covers types of networks, various network implementations, distributed computing, using the network for communicating with other users, and using various networking utilities (such as ssh, scp, telnet, ftp, pine, host, and more).
Chapters 2, 3, and 4 explain how to create, delete, copy, move, and search for information by using GNU/Linux utilities. You also learn how to use the GNU/Linux file structure to organize the information you store on your computer.
Chapters 2 and 3 and Part III include information on how to use utilities (pine, mail, talk, write) to communicate with users on your system and other systems. Chapter 9 details how to address electronic mail to users on remote, networked systems. Chapter 17 has a section on using sendmail.
Chapter 5 introduces the concepts of standard input, standard output, redirection, pipes, background processes, filename generation, and builtin commands. It shows you how to redirect output from a program to a printer or a file simply by changing the command line. The chapter also demonstrates how you can use pipes to combine utilities to solve problems right from the command line.
Shell Programming (Shell Scripts)Once you have mastered the basics of Red Hat Linux, you can use your knowledge to build more complex and specialized programs, using a shell as a programming language. Chapter 12 picks up where Chapter 5 leaves off, covering more advanced aspects of working with a shell, using for examples the Bourne Again Shellbash, the shell used almost exclusively for system shell scripts. Chapter 13 shows how to use bash to write scripts composed of GNU/Linux system utilities. Chapter 14 covers the TC Shell—tcsh, an improved version of Berkeleys C Shell. Chapter 15 covers the Z Shell—zsh, similar to the Korn Shell—extending the concepts of shell programming introduced in Chapter 13 into more advanced areas, including more information on the locality of variables, recursion, and the coprocess. The examples in Part III also demonstrate many features of the utilities you can use in shell scripts.
Job ControlThe job control commands, which originated on Berkeley UNIX, allow you to work on many jobs at once from a single window and to switch back and forth between the jobs as desired. Job control is available under the three major shells.
Shell FunctionsShell functions available in the bash and zsh Shells enable you to write your own commands that are similar to the aliases provided by the TC Shell, only more powerful.
Chapter 6 discusses the X Window System and how to open and control windows, customize your X work environment, and use some of the features common to GNOME and KDE. Chapter 7 covers GNOME and Chapter 8 covers KDE.
X Window SystemLinux includes hundreds of utilities. Part III contains extensive examples of how to use many of these utilities to solve problems without resorting to programming in C or another language. The example sections of gawk (more than 20 pages, starting on page 1185), sed (page 1310), and sort (page 1326) give real-life examples that demonstrate how to use these utilities alone and with other utilities to generate reports, summarize data, and extract information.
Secure UtilitiesMany newer utilities establish secure connections, encrypt data, and verify the identify of the creator/sender of files. Appendix C discusses security issues and solutions; Chapter 9 and Part III explain the use of secure utilities, including ssh, scp, and pgp.
The vim EditorRed Hat Linux supplies the vim text editor, an improved version of vi. The vi editor was originally a part of Berkeley UNIX and is still one of the most widely used text editors. Chapter 10 starts with a tutorial on vim and goes on to explain how to use many of the advanced features of vim, including special characters in search strings, the general-purpose and named buffers, parameters, markers, and executing commands from vim.
The emacs EditorRed Hat Linux supplies the popular GNU emacs editor. Chapter 11 includes information on emacs and the X Window System, allowing you to use a mouse and take advantage of such X Window System features as menus and cut-and-paste with emacs. This chapter explains how to use many of the features of this versatile editor, from a basic orientation to the use of the META, ALT, and ESCAPE keys; key bindings, buffers, the concept of Point, the cursor, Mark and Region, incremental and complete searching for both character strings and regular expressions; using the online help facilities, cutting and pasting from the keyboard and with a mouse, and using multiple windows and frames; and C mode, which is designed to aid programmers in writing and debugging C code. The chapter concludes with a summary of emacs commands.
Regular ExpressionsMany UNIX utilities allow you to use regular expressions to make your job easier. Appendix A explains how to use regular expressions so that you can take advantage of some of the hidden power of your GNU/Linux system.
System AdministrationChapter 17 explains how to set up, control, and keep secure a Red Hat Linux system. The chapter details the responsibilities of the Superuser and explains how to bring up and shut down a Red Hat Linux system, add users to the system, back up files, set up new devices, check the integrity of a filesystem, and more. This chapter goes into detail about the structure of a filesystem and explains what administrative information is kept in various files. In addition, this chapter presents an overview of installing Red Hat Linux, information on rebuilding the GNU/Linux kernel, and managing user accounts, and it provides security boxes throughout:
Chapter 16 introduces you to GNU/Linuxs exceptional programming environment. This chapter explains how to use some of the most useful software development tools: gcc (the GNU C compiler), the gdb debugger, make, and the CVS and RVS source code management tools. The make utility automates much of the drudgery involved in ensuring that a program you compile contains the latest versions of all program modules. CVS and RVS help you manage source code by tracking multiple versions of files on various types of projects.
The IEEE POSIX committees have developed standards for programming and user interfaces, based on historical UNIX practice, and new standards are under development. Appendix D describes these standards and their direction and effect on the UNIX and GNU/Linux industry.
The authors home page (www.sobell.com) contains downloadable listings of the longer programs from the book, pointers to many interesting and useful GNU/Linux sites on the World Wide Web, a list of corrections to the book, answers to selected exercises, and a solicitation for corrections, comments, suggestions, and additional programs and exercises.
A big Thank You to the folks who read through the drafts of the book and made comments that caused me to refocus parts of the book where things were not clear or were left out altogether. Thanks to Carsten Pfeiffer, Software Engineer and KDE Developer; Dustin Puryear, Puryear Information Technology; Gabor Liptak, Independent Consultant; Bart Schaefer, Chief Technical Officer, iPost; Michael J. Jordan, Web Developer, GNU/Linux Online Inc.; Steven Gibson, owner of SuperAnt.com; John Viega, Founder and Chief Scientist, Secure Software, Inc.; K. Rachael Treu, Internet Security Analyst, Global Crossing; Kara Pritchard, K & S Pritchard Enterprises, Inc; Matthew Miller, Boston University; Glen Wiley, Capitol One Finances; Karel Baloun, Senior Software Engineer, Looksmart, Ltd.; Matthew Whitworth; Dameon D. Welch-Abernathy, Nokia Systems; Josh Simon, Consultant; Stan Isaacs; and Dr. Eric H. Herrin, II, Vice President, Herrin Software Development, Inc.
Thanks to Doug Hughes, who gave me a big hand with the sections on system administration, networks, the Internet, and programming.
Thanks also to the folks at Addison-Wesley who helped bring this book to life: My editor Karen Gettman; Tyrrell Albaugh, production manager, who gave me guidance and much latitude in producing the book; and everyone else who worked behind the scenes to make this book happen.
Thanks to the Texan, JFP (Dr. John Frank Peters), for his many hours on the emacs chapter. His understanding of this editor gives this chapter a depth and breadth that makes you want to dive right in. Fred Zlotnick, author of The POSIX.1 Standard, did a lot of work on Appendix D.
I am also indebted to Denis Howe, who edits The Free On-line Dictionary of Computing. Dennis has graciously permitted me to use entries from his compilation. Be sure to look at the dictionary at foldoc.doc.ic.ac.uk/foldoc .
Thanks to Lorraine Callahan and Steve Wampler, who researched, wrote, analyzed reviews, and coordinated all the efforts that went into the first Linux book. Thanks for help on my first Linux book to Ronald Hiller, Graburn Technology, Inc.; Charles A. Plater, Wayne State University; Bob Palowoda, Tom Bialaski, Sun Microsystems; Roger Hartmuller, TIS Labs at Network Associates; Kaowen Liu, Andy Spitzer, Rik Schneider, Jesse St. Laurent, Steve Bellenot, Ray W. Hiltbrand, Jennifer Witham, Gert-Jan Hagenaars, and Casper Dik.
A Practical Guide to Red Hat Linux 8 is based in part on two of my previous UNIX books: UNIX System V: A Practical Guide and A Practical Guide to Linux. Many people helped me with those books, and thanks here go to Pat Parseghian, Dr. Kathleen Hemenway, and Brian LaRose; Byron A. Jeff, Clark Atlanta University; Charles Stross; Jeff Gitlin, Lucent Technologies; Kurt Hockenbury; Maury Bach, Intel Israel Ltd.; Peter H. Salus; Rahul Dave, University of Pennsylvania; Sean Walton, Intelligent Algorithmic Solutions; Tim Segall, Computer Sciences Corporation; Behrouz Forouzan, DeAnza College; Mike Keenan, Virginia Polytechnic Institute and State University; Mike Johnson, Oregon State University; Jandelyn Plane, University of Maryland; Arnold Robbins and Sathis Menon, Georgia Institute of Technology; Cliff Shaffer, Virginia Polytechnic Institute and State University; and Steven Stepanek, California State University, Northridge, for reviewing the book.
I also continue to be grateful to the many people who helped with the early editions of my UNIX books. Special thanks to Roger Sippl, Laura King, and Roy Harrington for introducing me to the UNIX system. My mother, Dr. Helen Sobell, provided invaluable comments on the original manuscript at several junctures. Also thanks to Isaac Rabinovitch, Professor Raphael Finkel, Professor Randolph Bentson, Bob Greenberg, Professor Udo Pooch, Judy Ross, Dr. Robert Veroff, Dr. Mike Denny, Joe DiMartino, Dr. John Mashey, Diane Schulz, Robert Jung, Charles Whitaker, Don Cragun, Brian Dougherty, Dr. Robert Fish, Guy Harris, Ping Liao, Gary Lindgren, Dr. Jarrett Rosenberg, Dr. Peter Smith, Bill Weber, Mike Bianchi, Scooter Morris, Clarke Echols, Oliver Grillmeyer, Dr. David Korn, Dr. Scott Weikart, and Dr. Richard Curtis.
Dr. Brian Kernighan and Rob Pike graciously allowed me to reprint the bundle script from their book The UNIX Programming Environment.
Finally, thanks to the brothers at JumpStart for providing nourishment through the final push. As Peter said, You wouldnt have finished that book until 2010 if it werent for us!
I take responsibility for errors and omissions. If you find one or just have a comment, let me know (mark@sobell.com), and Ill fix it in the next printing. My home page (www.sobell.com) will contain a list of errors and those who found them, as well as copies of the longer scripts from the book and pointers to many interesting GNU/Linux pages.
Mark G. Sobell
San Francisco, California