A Practical Guide to Red Hat Linux with Cdrom
Authors: Mark G. Sobell
Venue:  (2002)

From the Book:This is a straightforward, easy-to-read, logically organized book about GNU/Linux1 by an author who has been writing successful books on UNIX/Linux operating systems for over 20 years. It is for people with some computer experience but little or no experience with a UNIX/Linux system. 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 Red Hat Linux version 7 in particular. In Parts I and II, A Practical Guide to Red Hat Linux shows you how to Log in on and get familiar with your systemChapters 2-5 Use and customize graphical user interfaces (GUIs)Chapters 6-8 Understand and use networksChapter 9 Master the vim and emacs text editorsChapters 10-11 Work with the bash, tcsh, and zsh ShellsChapters 12-15 Write complex shell programs (scripts)Chapters 13-15 Use sophisticated software development toolsChapter 16 Perform system administrationChapter 17 Part III is a reference guide to more than 85 GNU/Linux utilities. You do not have to read this book in page order. Once you are comfortable using GNU/Linux, you can use it as a reference book: Look up a topic of interest in the 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.Audience This book appeals to a a wide range of readers; it does not require programming experience, but some experience using any general-purpose computer is helpful. It is appropriate for Students taking a class in which they use GNU/Linux People who want to set up and/or run GNU/Linux at home Professionals who use GNU/Linux at work Computer science students studying the GNU/Linux operating system Programmers who need to understand the GNU/Linux programming environment Technical Executives who want to get a grounding in GNU/Linux Benefits A Practical Guide to Red Hat Linux gives you a broad understanding of many facets of GNU/Linux, from using it through customizing it. Whether you are a programmer/ developer 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. Scope of Coverage A Practical Guide to Red Hat Linux covers a wide range of topics. The following sections highlights some of the features of this book.Parts I, II, and III A Practical Guide to Red Hat Linux shows you how to use Red Hat Linux from your screen and keyboard. Part I comprises Chapters 1-5, which introduce new users To red Hat Linux: introduction, logging on, basic utilities, filesystem structure, and the shell. Part I contains step-by-step tutorials covering the most important aspects of the GNU/Linux operating system. Part II comprises Chapters 6 through 17, which cover int aspects of Red Hat Linux: GUI interfaces, networking, the vim and emacs editors, the Bourne Again, TC, and Z Shells and shell scripts, programming tools, and system administration. Part III offers a comprehensive, detailed reference to more than 85 GNU/Linux utilities, with numerous examples. If you are already familiar with UNIX/Linux this part of the book will be a valuable, easy-to-use reference. If you are not an experienced user, you will find Part III a useful supplement while you are mastering the subjects and tutorials in Parts I and II. TIP: Experienced Users May Want to Skim Part IIf 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 27), which explains the typographic and layout conventions that this book uses, and "Documentation beef up infcoverage" (page 46) 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 the reader's understanding of material covered in the chapter, while others challenge the reader to go beyond the material presented to develop a more thorough understanding. Features by Chapter This book features: The history and background of GNU/Linux (Chapter 1) Conventions used in this book, how to log in on your system, and usi the documentation systems (Chapter 2) Basic utilities (Chapter 3) The GNU/Linux filesystem structure (Chapter 4) The (generic) shell (Chapter 5) An introduction to GUIs including the X Window System (Chapters 6) The X Window System: Use and customization (Chapter 6) The GNOME desktop environment (GUI interface, Chapter 7) The KDE desktop environment (GUI interface, Chapter 8) Networks: concepts, terminology, and practical instructions for setting up a secure network (Chapters 9 and 17) Secure utilities: ssh, scp, gpg, lokkit, and more (Chapter 9, Part III, and Appendix C) The vim and emacs text editors (Chapters 10 and 11) Using the shells interactively and as programming languages: the Bourne Again Shellbash(Chapters 12 and 13), the TC Shelltcsh(Chapter 14), and the Z Shellzsh(Chapter 15). Programming tools: C, make, source code managementRCS and CVS (Chapter 16) System administration (Chapter 17) Over 85 utilities including many examples (Part III) Appendixes covering Regular expressions (Appendix A) Finding software and pointers to useful Web pages (Appendix B) Security: An overview of this important topic (Appendix C) POSIX: standards that specify a standard UNIX/Linux (Appendix D) GNU's Free Software Definition (Appendix E) A comprehensive glossary of over 500 words and phrases A comprehensive index Features A security conscious perspective: Places where you can improve system security, including network security, are pointed out by security boxes throughout the book Key topics with tutorials: pico, vim (vi improved), and emacs text editors; pine mail and news reader, and more Finding and installing software: Web sites, rpm, and the GNU Configure and Build System Finding online documentationboth local and on the Internet Important GNU tools including gcc, gdb, GNU Configure and Build System, gawk, gzip, and many others Tutorials pictext editor emacs text editor and programmer's environment vim (vi improved) editor pine as a mail program pine as a newsreader Assistance Many examples throughout Comprehensive index Caution boxes warn you of the consequences of taking certain actions Security boxes alert you to security issues Tip boxes help you avoid pitfalls Help in obtaining online documentation from many sources including your local system, the Red Hat documentation CDROM, the Red Hat Web site, GNU, and other locations on the Internet Appendix B, Help! lists many useful URLs (Internet addresses) where you can obtain software, security programs and information, and more Features by Topic Red Hat Linux A Practical Guide to Red Hat Linux is based on Red Hat version 7.3, although much of it is compatible with other versions and distributions of GNU/Linux A complete c implementation: structure, types of files, links, pathnames, permissions, locations for common files; and utilities that change filesystems System administration under Red Hat Linux: Red Hat has built and contributed to many tools for system administration including rpm (Red Hat Program Manager) which makes it a simple matter to install or remove program packages, RHN (Red Hat Network) which can keep your system programs and files up-to-the-minute up-to-date automatically, redhat-config-users (sets up users on the system), printconf-gui (configures printers), and many more. A chapter each on the GNOME version 2 and KDE version 3 graphical desktops as configured by Red Hat. Networking, the Internet, and the World Wide Web Chapter 9 explains what a network is, how it works, and how you can use it. It coves types of networks, various network implementations, distributed computing, how to use the network for communicating with other users, and using various networking utilities (such as ssh, scp, telnet, ftp, pine, host, and more). Broad Internet coverage including firewalls, network services, types of networks and their operation, network protocols, and IPv6. Complete instructions on using free software: finding, downloading, and installing free software from the Internet using a variety of tools Guidance on using networking tools including ping, host, dig, traceroute, swat (Samba), and more Coverage of distributed computing including DNS, NIS, NFS, proxy servers, Internet services, and more. Organizing Information In Chapters 2, 3, and 4, you learn how to create and search for information using GNU/Linux utilities. You will also learn how to use the GNU/Linux file structure to organize the information you store on your computer. Electronic Mail and Telecommunications 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.The Shells Chapter 5 is an introductory shell chapter that 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just by changing the command line. It 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 the Bourne Again Shellbash, the shell used almost exclusively for system shell scriptsfor examples. 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 Berkeley's 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 Control The job control commands, which originated on Berkeley UNIX, allow you to work on many jobs at once from a single window, and switch back and forth between the jobs as desired. Job control is available under the three major Shells. Shell Functions Shell Functions are available in the bash and zsh Shells and enable you to write your own commands that are similar to the aliases provided by the TC Shell, only more powerful. The X Window System and Graphical User Interfaces (GUIs) 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 while Chapter 8 covers KDE.X Window System Window managers Bringing up and shutting down the X Window System Setting X resources Using the X Window System Customizing the X Window System Remote Computing and Local Displays GNOME Graphical Desktop Main panel: control center of the GNOME desktop Menus: the key to using GNOME Nautilus file manager and browser: The cornerstone GNOME utility including the Start Here window, control bars, and properties. GNOME utilities: Search, terminal emulator, pick a font, pick a color, MIME types, and much more Customizing GNOME: Nautilus, panels, and menus Sawfish window manger: window operations, menus, and configurator KDE Graphical Environment Main panel (kicker): Control center of the KDE desktop Menus: The key to using KDE, including the Desktop menu and menubar, Taskbar, Window List menu, and Operations menu Konqueror browser and file manager: Views, toolbars, find files, shortcuts, Navigation panel How to get help: What's this?, KHelpcenter, Help menu Window manager: using and modifying kwin Customizing KDE: Control center, panels, toolbars, K Menu editor, autostart, and sound. Utilities Linux 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 (over 20 pages, starting on page 1239), sed (page 1378), and sort (page 1395) 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 Utilities Many newer utilities establish secure connections, encrypt data, and verify the identify of the creator/sender of files. Appendix C discusses security issues and solutions while Chapter 9 and Part III explain the use of secure utilities including ssh, scp, and pgp. The vim Editor Red 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 wid 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 X Window System features such 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 Expressions Many 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 Administration Chapter 17 explains how to set up, control, and keep secure a Red Hat Linux system. It 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 175+ page chapter presents an overview of installing Red Hat Linux, information on rebuilding the GNU/Linux kernel, a section on how to manage user accounts, and security boxes throughout. Use the Superuser (root) account Download Red Hat Linux from the Internet and burn a CDROM Find/add/remove rpm software packages with use rpmfind, rpm, and kpackage Install non-rpm software with the GNU Configure and Build System Understand and manage basic security issues with secure programs including ssh (secure shell), and GnuPG (GNU Privacy Guard) Add and remove users with redhat-config-users and kuser Use RHN (Red Hat Network) to keep your system software up to date automatically Build a firewall with gnome-lokkit Manage local and remote printers with printconf-gui and KDEPrint Use graphical system administration tools including GNOME Start Here, GNOME and KDE menu systems, KDE Control Center, and KDE Control Panel Understand system operation including the boot process, rc scripts, emergency mode, single- and multiuser mode, and what to do when the system crashes Learn about files, directories, and filesystems including types of files and filesystems, fstab, automatically mounted filesystems, filesystem integrity checks, filesystem utilities, and how to tunene filesystems Use backup utilities including tar, cpio, dump, and restore Use the /proc filesystem Configure ne (Domain Name Service), automount filesystems, Samba server, OpenSSH Rebuild the Kernel Plan disk layout and partition disks Run system reports Manage printers Connect to the Internet Rebuild the kernel Configure PAM (pluggable authentication modules) Use administration utilities Programming Environment Manage source code with RCS or CVS Use make to keep a set of programs current Use the GNU C compiler (gcc) and debugger (dbg) Work with shared libraries Understand system calls Programming Tools Chapter 16 introduces you to GNU/Linux's exceptional programming environment. This chapter describes 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 a number of different types of projects. POSIX 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 industry. Supplements My home page (www.sobell.com) contains downloadable listings of the longer programs from the book; current pointers to many interesting and useful Red Hat Linux the book; answers to selected exercises, and a solicitation for corrections, comments, suggestions, and additional programs and exercises.I take responsibility for errors and omissions. If you find one or just have a comment, let me know (mark@sobell.com), and I'll fix it in the next printing. My home page (www.sobell.com) contains a list of all the errors found so far, and who found them. It also contains copies of the longer scripts from the book and pointers to many interesting GNU/Linux pages. Mark G. Sobell San Francisco, California 1Proper credit is due the Free Software Foundation/GNU for its contribution to the operating system which is commonly referred to as Linux. Thus, This book uses the name GNU/Linux in places where others use Linux by itself. Red Hat Linux is a distribution of GNU/Linux. Refer to the beginning of Chapter 1 for more information on the development of GNU/Linux.