• No results found

Oreilly Linux In A Nutshell 4Th Ed pdf

N/A
N/A
Protected

Academic year: 2020

Share "Oreilly Linux In A Nutshell 4Th Ed pdf"

Copied!
1079
0
0

Loading.... (view fulltext now)

Full text

(1)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

(2)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Copyright

Preface

Other Resources

Conventions

We'd Like to Hear from You

Acknowledgments

Chapter 1. Introduction

Section 1.1. The Excitement of Linux

Section 1.2. Distribution and Support

Section 1.3. Commands on Linux

Section 1.4. What This Book Offers

Section 1.5. Sources and Licenses

Section 1.6. Beginner's Guide

Chapter 2. System and Network Administration Overview

Section 2.1. Common Commands

Section 2.2. Overview of Networking

Section 2.3. Overview of TCP/IP

Section 2.4. Overview of Firewalls and Masquerading

Section 2.5. Overview of NFS

Section 2.6. Overview of NIS

Section 2.7. Administering NIS

Section 2.8. RPC and XDR

Chapter 3. Linux Commands

Section 3.1. Alphabetical Summary of Commands

Chapter 4. Boot Methods

Section 4.1. The Boot Process

Section 4.2. LILO: The Linux Loader

(3)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Section 4.4. GRUB Commands

Section 4.5. Loadlin: Booting from MS-DOS

Section 4.6. Dual-Booting Linux and Windows NT/2000/XP

Section 4.7. Boot-Time Kernel Options

Section 4.8. initrd: Using a RAM Disk

Chapter 5. Red Hat and Debian Package Managers

Section 5.1. The Red Hat Package Manager

Section 5.2. The Debian Package Manager

Chapter 6. The Linux Shells: An Overview

Section 6.1. Purpose of the Shell

Section 6.2. Shell Flavors

Section 6.3. Common Features

Section 6.4. Differing Features

Chapter 7. bash: The Bourne-Again Shell

Section 7.1. Invoking the Shell

Section 7.2. Syntax

Section 7.3. Variables

Section 7.4. Arithmetic Expressions

Section 7.5. Command History

Section 7.6. Job Control

Section 7.7. Built-in Commands

Chapter 8. tcsh: An Extended C Shell

Section 8.1. Overview of Features

Section 8.2. Invoking the Shell

Section 8.3. Syntax

Section 8.4. Variables

Section 8.5. Expressions

Section 8.6. Command History

Section 8.7. Command-Line Manipulation

Section 8.8. Job Control

Section 8.9. Built-in Commands

Chapter 9. Pattern Matching

Section 9.1. Filenames Versus Patterns

Section 9.2. Metacharacters, Listed by Linux Program

Section 9.3. Metacharacters

Section 9.4. Examples of Searching

Chapter 10. The Emacs Editor

Section 10.1. Emacs Concepts

Section 10.2. Typical Problems

Section 10.3. Notes on the Tables

Section 10.4. Summary of Commands by Group

Section 10.5. Summary of Commands by Key

Section 10.6. Summary of Commands by Name

Chapter 11. The vi Editor

Section 11.1. Review of vi Operations

Section 11.2. vi Command-Line Options

Section 11.3. ex Command-Line Options

(4)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Section 11.5. Edit Commands

Section 11.6. Saving and Exiting

Section 11.7. Accessing Multiple Files

Section 11.8. Window Commands

Section 11.9. Interacting with the Shell

Section 11.10. Macros

Section 11.11. Miscellaneous Commands

Section 11.12. Alphabetical List of Keys in Command Mode

Section 11.13. Syntax of ex Commands

Section 11.14. Alphabetical Summary of ex Commands

Section 11.15. vi Configuration

Chapter 12. The sed Editor

Section 12.1. Command-Line Syntax

Section 12.2. Syntax of sed Commands

Section 12.3. Group Summary of sed Commands

Section 12.4. Alphabetical Summary of sed Commands

Chapter 13. The gawk Scripting Language

Section 13.1. Command-Line Syntax

Section 13.2. Patterns and Procedures

Section 13.3. gawk System Variables

Section 13.4. PROCINFO Array

Section 13.5. Operators

Section 13.6. Variable and Array Assignments

Section 13.7. Group Listing of gawk Commands

Section 13.8. Alphabetical Summary of Commands

Chapter 14. RCS

Section 14.1. Overview of RCS Commands

Section 14.2. Basic RCS Operations

Section 14.3. General RCS Specifications

Section 14.4. Alphabetical Summary of RCS Commands

Chapter 15. CVS

Section 15.1. Basic Concepts

Section 15.2. CVS Command Format

Section 15.3. Common Global Options

Section 15.4. Gotchas

Section 15.5. CVS Administrator Reference

Section 15.6. CVS User Reference

Chapter 16. Graphical Desktop Overview

Section 16.1. Desktop Environments and Window Managers

Section 16.2. Desktop Differences: Development

Chapter 17. GNOME

Section 17.1. Desktop Overview

Section 17.2. The Panel

Section 17.3. The GNOME Menu and the Menu Panel Menus

Section 17.4. The GNOME Control Center

Section 17.5. History and Changes in GNOME 2

Chapter 18. KDE

(5)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Section 18.2. The Panel

Section 18.3. The KDE Control Center

Chapter 19. An Alternative Window Manager: fvwm2

Section 19.1. Running fvwm2

Section 19.2. Implementing Window Manager Customizations

Section 19.3. Adding Keyboard Shortcuts

Section 19.4. Customizing Menus

Section 19.5. The WinList: Switching the Focus

Colophon

Index

(6)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Copyright © 2003, 2000, 1999, 1997 O'Reilly & Associates, Inc.

Printed in the United States of America.

Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O'Reilly & Associates books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected].

Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of an Arabian horse and the topic of Linux is a trademark of O'Reilly & Associates, Inc.

While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

(7)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Preface

This is a book about Linux, a freely available clone of the Unix operating system whose uses range from embedded systems and personal data assistants (PDAs) to corporate servers, web servers, and massive clusters that perform some of the world's most difficult computations.

Whether you are using Linux for personal software projects, for a small office or home office (the so-called SOHO environment), to provide services to a small group of colleagues, or to administer a site responsible for millions of email and web connections each day, you need quick access to information on a wide range of tools. This book covers all aspects of administering and making effective use of Linux systems. Among its topics are booting, package management, and the configuration of the GNOME and KDE desktops. But

foremost in Linux in a Nutshell are the immeasurable utilities and commands that make Linux one of the most powerful and flexible systems available.

In addition to the tools and features written specifically for it, Linux has inherited many from the Free Software Foundation's GNU project, the Berkeley Software Distribution (BSD), the X Window System

(XFree86), and contributions from major corporations as well as the companies that created the major Linux distributions. More recent projects extend Linux in exciting ways, some through changes to the kernel and some through libraries and applications that radically change the user's experience; the GNOME and KDE desktops are the most prominent examples.

This book is a quick reference for the basic commands and features of the Linux operating system. As with other books in O'Reilly's "In a Nutshell" series, this book is geared toward users who know what they want to do and have some idea how to do it, but can't always remember the correct command or option.

(8)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Other Resources

This book doesn't tell you how to install and come up to speed on a Linux system. For that, you will probably want O'Reilly's Learning Red Hat Linux , which contains a Linux distribution on CD-ROM and provides help with installation and configuration. Alternatively, Running Linux is an in-depth guide suitable for all major

distributions. For networking information, check out the Linux Network Administrator's Guide . In addition to these and other Linux titles, O'Reilly's wide range of Unix, X, Perl, and Java titles may also be of interest to the Linux user.

Online Documentation

The Internet is full of information about Linux. One of the best resources is the Linux Documentation Project at http://www.tldp.org (or one of the dozens of mirror sites around the world), which has numerous short guides called HOWTOs, along with some full manuals. For online information about the GNU utilities covered in this book, consult http://www.gnu.org (also widely mirrored). The Free Software Foundation, which is in charge of the GNU project, publishes its documentation in a number of hard-copy and online books about various tools.

Each distribution maintains its own web site, and contains documentation for the software it provides as well as guides to maintaining your system under that distribution.

Web Sites

As befits a hot phenomenon, Linux is the central subject of several web sites and a frequent topic of

discussion on others. Some sites offer original content; others just have links to articles posted elsewhere and threaded discussions (which can be a useful service). Among the sites frequented by Linux users are:

http://www.lwn.net

Linux Weekly News, a site with weekly in-depth articles and frequent news updates http://www.linuxgazette.com

Linux Gazette, a site published monthly by Linux Journal with articles and tips in many languages http://linuxsecurity.com

Linux Security, a collection of security-related news http://slashdot.org

Slashdot, a famous discussion list http://linuxinsider.com

Linux Insider, a news feed http://linuxtoday.com

Linux Today, another news feed http://newsforge.com

NewsForge, a more general computing-related news feed

Linux Journal and Linux Magazine

(9)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

questions and answers to kernel programming internals. Linux Journal, at http://www.linuxjournal.com, is the older magazine and is published by S.S.C. Incorporated, http://www.ssc.com. Linux Magazine is at

http://www.linuxmagazine.com.

Usenet Newsgroups

Most people can receive Usenet news at work or through their ISPs. While this communications technology has lost ground in the past several years to web-based threaded discussions, it is still a valuable source of help and community connections on many topics. The following Linux-related newsgroups are popular:

comp.os.linux.announce

A moderated newsgroup containing announcements of new software, distributions, bug reports, and goings-on in the Linux community. All Linux users should read this group. Submissions may be mailed to [email protected].

comp.os.linux.help

General questions and answers about installing or using Linux. comp.os.linux.admin

Discussions relating to systems administration under Linux. comp.os.linux.development

Discussions about developing the Linux kernel and the system itself. comp.os.linux.networking

Discussions relating to networking with Linux. comp.os.linux.security

Help with firewalls, securing servers, and other security issues. comp.os.linux.x

Help on getting the X graphical window system to work. This list used to see some of the highest traffic of any Linux group back when distributions had more trouble setting up graphics automatically. This is no longer the case, thanks to the increasing sophistication of autodetection and configuration software.

There are also several newsgroups devoted to Linux in languages other than English, such as fr.comp.os.linux in French and de.comp.os.linux in German.

Online Linux Support

There are many ways of obtaining help online, where volunteers from around the world offer expertise and services to assist users with questions and problems.

The freenode IRC service is an Internet relay chat network devoted to so-called "peer-directed" projects, particularly those involving free software. Some of its channels are designed to provide online Linux support services.

Internet relay chat is a network service that allows you to talk interactively on the Internet to other users. IRC networks support multiple channels where different groups of people type their thoughts. Whatever you type in a channel is seen by all other users of that channel.

(10)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

#linpeople General help and discussion.

#debian Help for Debian distribution.

#gentoo Help for Gentoo distribution.

#redhat Help for Red Hat distribution.

#suse Help for SuSE distribution.

And so on. Please be sure to read up on the rules of chat etiquette before chatting. In particular, the participants in these groups tend to expect people to read documentation and do some experimentation before asking for help with a problem.

Linux User Groups

Many Linux User Groups around the world offer direct support to users. Typically, Linux User Groups engage in such activities as installation days, talks and seminars, demonstration nights, and purely social events. Linux User Groups are a great way of meeting other Linux users in your area. There are a number of published lists of Linux User Groups. Some of the better-known ones are:

Groups of Linux Users Everywhere: http://www.ssc.com/glue/groups LUGregistry: http://www.linux.org/users

(11)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Conventions

This desktop quick reference follows certain typographic conventions:

Bold

is used for commands, programs, and options. All terms shown in bold are typed literally. Italic

is used to show arguments and variables that should be replaced with user-supplied values. Italic is also used to indicate filenames and directories and to highlight comments in examples.

Constant Width

is used to show the contents of files or the output from commands.

Constant Width Bold

is used in examples to show commands or other text that should be typed literally by the user.

Constant Width Italic

is used in examples to show text that should be replaced with user-supplied values. %, $

are used in some examples as the tcsh shell prompt (%) and as the Bourne or bash shell prompt ($). [ ]

surround optional elements in a description of syntax. (The brackets themselves should never be typed.) Note that many commands show the argument [files]. If a filename is omitted, standard input (e.g., the keyboard) is assumed. End with an end-of-file character.

EOF

indicates the end-of-file character (normally Ctrl-D). |

is used in syntax descriptions to separate items for which only one alternative may be chosen at a time.

This icon indicates a note, which is an important aside to its nearby text.

This icon indicates a warning.

A final word about syntax. In many cases, the space between an option and its argument can be omitted. In other cases, the spacing (or lack of spacing) must be followed strictly. For example, -wn (no intervening space) might be interpreted differently from -wn. It's important to notice the spacing used in option syntax.

(12)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

We'd Like to Hear from You

We have tested and verified all of the information in this book to the best of our ability, but you may find that features have changed (or even that we have made mistakes!). Please let us know about any errors you find, as well as your suggestions for future editions, by writing:

O'Reilly & Associates, Inc.

1005 Gravenstein Highway North Sebastopol, CA 95472

(800) 998-9938 (in the United States or Canada) (707) 829-0515 (international or local)

(707) 829-0104 (fax)

There is a web page for this book, which lists errata, examples, or any additional information. You can access this page at:

http://www.oreilly.com/catalog/linuxnut4/

To comment or ask technical questions about this book, send email to:

[email protected]

For more information about books, conferences, Resource Centers, and the O'Reilly Network, see the O'Reilly web site at:

http://www.oreilly.com

(13)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Acknowledgments

This fourth edition of Linux in a Nutshell is the result of the cooperative efforts of many people. Thanks to Andy Oram for his editorial skills, as well as for pitching in to check existing chapters and update and write new material as needed.

For technical review, thanks go to Matt Welsh of Running Linux and Installation and Getting Started Guide fame, Michael K. Johnson of Red Hat Software, Robert J. Chassell, Phil Hughes of Linux Journal, Laurie Lynne Tucker, Arnold Robbins, Julian T. J. Midgley, Matthias Kalle Dalheimer, Terry Dawson, Doug Moreen, Ron Passerini, and Mark Stone.

(14)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Chapter 1. Introduction

It is hard to chart the rise of Linux over its twelve years of existence without risking the appearance of exaggeration and hyperbole. During the past five years alone, Linux has grown from a student/hacker

playground to an upstart challenger in the server market to a well-respected system taking its rightful place in educational and corporate networks. Many serious analysts claim that its trajectory has just begun, and that it will eventually become the world's most widespread operating system.

Linux was first developed by Linus Torvalds at the University of Helsinki in Finland. From his current location in Silicon Valley, Linus continues to centrally coordinate improvements. The Linux kernel continues to develop under the dedicated cultivation of a host of other programmers and hackers all over the world, joined by members of programming teams at major computer companies, all connected through the Internet.

By "kernel," we mean the core of the operating system itself, not the applications (such as the compiler, shells, and so forth) that run on it. Today, the term "Linux" is often used to mean a software environment with a Linux kernel along with a large set of applications and other software components. In this larger meaning, many people prefer the term GNU/Linux, which acknowledges the central role played by tools from the Free Software Foundation's GNU project in the development of the kernel.

Linux systems cannot be technically referred to as a "version of Unix," as they have not undergone the required tests and licensing.[1] However, Linux offers all the common programming interfaces of standard Unix systems, and as you can see from this book, all the common Unix utilities have been reimplemented on Linux. It is a powerful, robust, fully usable system for those who like Unix.

[1] Before an operating system can be called "Unix," it must be branded by The Open Group.

The historical impact of Linux goes beyond its role as a challenge to all versions of Unix as well as Microsoft Windows, particularly on servers. Linux's success has also inspired countless other free software or open source (defined at http://opensource.org) projects, including Samba, GNOME, and a mind-boggling collection of innovative projects that you can browse at numerous sites like SourceForge (http://sourceforge.net). As both a platform for other developers and a development model, Linux gave a tremendous boost to the GNU project, and has also become a popular platform for Java development. In short, Linux is a central participant in the most exciting and productive free software movement ever seen.

If you haven't obtained Linux yet, or have it but don't know exactly how to get started using it, see Other Resources in the preface.

(15)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.1 The Excitement of Linux

Linux is, first of all, free software: anyone can download the source from the Internet or buy it on a low-cost CD-ROM. But Linux is becoming well known because it's more than free software—it's unusually good

software. You can get more from your hardware with Linux and be assured of fewer crashes; even its security is better than many commercial alternatives.

Linux first appeared in organizations as ad hoc installations by hackers running modest web servers or development systems at universities and research institutions, but now extends deeply into corporations around the world. People deploying Linux for mission-critical systems tend to talk about its ample practical advantages, such as the ability to deliver a lot of bang for the buck and the ease of deploying other powerful tools on Linux such as Apache, Samba, and Java environments. They also cite Linux's ability to grow and sprout new features of interest to large numbers of users. But these advantages can be traced back to the concept of software freedom, which is the root of the broad wave of innovation driving Linux.

As free software, Linux revives the grand creativity and the community of sharing that Unix was long known for. The unprecedented flexibility and openness of Unix—which newcomers usually found confusing and frustrating, but eventually found they couldn't live without—continually inspired extensions, new tools like Perl, and experiments in computer science that sometimes ended up in mainstream commercial computer systems.

Many programmers fondly remember the days when AT&T provided universities with Unix source code at no charge, and the University of Berkeley started distributing its version in any manner that allowed people to get it. For these older hackers, Linux brings back the spirit of working together—all the more so because the Internet is now so widespread. And for the many who are too young to remember the first round of open systems or whose prior experience has been constricted by trying to explore and adapt proprietary operating systems, now is the time to discover the wonders of freely distributable source code and infinitely adaptable interfaces.

The economic power behind Linux's popularity is its support for an enormous range of hardware. People who are accustomed to MS-DOS and Microsoft Windows are often amazed at how much faster their hardware appears to work with Linux—it makes efficient use of its resources.

For the first several years, users were attracted to Linux for a variety of financial and political reasons, but soon they discovered an unexpected benefit: Linux works better than many commercial systems. With the Samba file and print server, for instance, Linux serves a large number of end-user PCs without crashing. With the Apache web server, it provides more of the useful features web administrators want than competing products do. Embedded versions of the Linux kernel are in growing use because, although they are larger than the most stripped-down operating systems, they deliver a range of powerful features within a remarkably small footprint.

Opinions still differ on how suitable Linux is as a general-purpose desktop system. But the tremendous advances in usability and stability of the desktop software and its applications are undisputed. Soon (if not today), one will find Linux in many offices and other end-user environments. Meanwhile, the strides made by Linux in everyday computing tasks are reflected in the new audio and CD-related commands found in this edition.

(16)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.2 Distribution and Support

While it is convenient to download one or two new programs over the Internet and fairly feasible to download something as large as the Linux kernel, getting an entire working system over the Internet is difficult without a high-speed Internet connection. Over the years, therefore, commercial and noncommercial packages called distributions have emerged. The first distribution consisted of approximately 50 diskettes, at least one of which would usually turn out to be bad and have to be replaced. When CD-ROM drives became widespread, Linux really took off.

After getting Linux, the average user is concerned next with support. While Usenet newsgroups offer very quick responses and meet the needs of many intrepid users, you can also buy support from the vendors of the major distributions and a number of independent experts. Linux is supported at least as well as commercial software. When you buy a distribution from a vendor, you typically are entitled to a period of free support as well.

Intel's x86 family and other compatible chips are still by far the most common hardware running Linux, but Linux is also now commercially available on a number of other hardware systems, notably the PowerPC, the 64-bit Intel Itanium processor, Sun Microsystems' SPARC, and the Alpha (created by Digital Equipment Corporation).

(17)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.3 Commands on Linux

Linux commands are not the same as standard Unix ones. They're better! This is because most of them are provided by the GNU project run by the Free Software Foundation (FSF). GNU means "GNU's Not Unix"—the first word of the phrase is expanded with infinite recursion.

Benefiting from years of experience with standard Unix utilities and advances in computer science,

programmers on the GNU project have managed to create versions of standard tools that have more features, run faster and more efficiently, and lack the bugs and inconsistencies that persist in the original standard versions.

While GNU provided the programming utilities and standard commands like grep, many of the system and network administration tools on Linux came from the Berkeley Software Distribution (BSD). In addition, some people wrote tools that specifically allow Linux to deal with special issues such as filesystems. This book documents all the standard Unix commands that are commonly available on most Linux distributions.

The third type of software most commonly run on Linux is the X Window System, ported by the XFree86 project to standard Intel chips. While this book cannot cover the wide range of utilities that run on X, we briefly cover some of the useful customizations you can make to your KDE, GNOME, or fvwm2 desktop.

(18)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.4 What This Book Offers

Originally based on the classic O'Reilly & Associates quick reference, Unix in a Nutshell , this book has been expanded to include much information that is specific to Linux. These enhancements include chapters on:

Package managers (which make it easy to install, update, and remove related software files)

The KDE and GNOME desktops and the fvwm2 window manager Boot parameters

The CVS version control system

The book also contains dozens of Linux-specific commands, along with tried-and-true Unix commands that have been supporting users for decades (though they continue to sprout new options).

This book does not cover the graphical tools contained in most distributions of Linux. Many of these, to be sure, are quite useful and can form the basis of everyday work. Examples of these tools include OpenOffice (the open source version of the StarOffice suite distributed by Sun Microsystems), Evolution (a mail, calendar, and office productivity tool from Ximian), Mozilla (the open source cousin of the Netscape web browser), and the GIMP (a graphic image manipulation program and the inspiration for the GNOME project). But they are not Linux-specific, and their graphical models do not fit well into the format of this book.

While you can do a lot of valuable work with the graphical applications, the core of Linux use is the text manipulation and administration done from the command line, within scripts, or using text editors such as vi and Emacs. Linux is still mostly a command-driven system, and this book continues to focus on this level of usage. In your day-to-day work, you'll likely find yourself moving back and forth between graphical programs and the commands listed in this book.

Every distribution of Linux is slightly different, but you'll find that the commands we document are the ones you use most of the time, and that they work the same on all distributions. Basic commands, programming utilities, system administration, and network administration are all covered. However, some areas were so big that we had to leave them out. The many applications that depend on the X Window System didn't make the cut. Nor did the many useful programming languages like Java, Perl, and Python with which users can vastly expand the capabilities of their systems. XML isn't covered here either. These subjects would stretch the book out of its binding.

Linux in a Nutshell doesn't teach you Linux—it is, after all, a quick reference—but novices as well as highly experienced users will find it of great value. When you have some idea of what command you want but aren't sure just how it works or what combinations of options give you the exact output required, this book is the place to turn. It can also be an eye-opener, making you aware of options that you never knew about before.

Once you're over the hurdle of installing Linux, the first thing you need to do is get to know the common utilities run from the shell prompt. If you know absolutely nothing about Unix, we recommend you read a basic guide (introductory chapters in the O'Reilly books Learning Red Hat Linux and Running Linux can get you started.) This chapter and Chapter 2 offer a context for understanding different kinds of commands (including commands for programming, system administration, and network administration). Chapter 3 is the central focus of the book, containing about one half its bulk.

(19)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

All commands are interpreted by the shell. The shell is simply a program that accepts commands from the user and executes them. Different shells sometimes use slightly different syntax to mean the same thing. Under Linux, two popular shells are bash and tcsh (which on Linux has supplanted the older csh), and they differ in subtle ways. (One of the nice things about Linux and other Unix systems is that you have a variety of shells to choose from, each with strengths and weaknesses.) We offer an introduction to shells in Chapter 6, thorough coverage of bash in Chapter 7, and a guide to tcsh in Chapter 8. You may decide to read these after you've used Linux for a while, because they mostly cover powerful, advanced features that you'll want when you're a steady user.

To get any real work done, you'll have to learn some big, comprehensive utilities, notably an editor and some scripting tools. Two major editors are used on Linux: vi and Emacs. Emacs is covered in Chapter 10 and vi in Chapter 11. Chapter 12 and Chapter 13 cover two classic Unix tools for manipulating text files on a line-by-line basis: sed and gawk (the GNU version of the traditional awk). O'Reilly offers separate books about these topics that you may find valuable, as they are not completely intuitive upon first use. (Emacs does have an excellent built-in tutorial, though; to invoke it, press Ctrl-H followed by t for "tutorial.")

CVS (Concurrent Versions System) and RCS (Revision Control System) manage files so you can retrieve old versions and maintain different versions simultaneously. Originally used by programmers who have

complicated requirements for building and maintaining applications, these tools have turned out to be valuable for anyone who maintains files of any type, particularly when coordinating a team of people. CVS has become a distribution channel for thousands of free software projects. Chapter 14 presents RCS commands, and Chapter 15 presents CVS commands.

Graphical desktops are covered in four chapters. Chapter 16 is a brief overview to the major options on Linux systems. It is followed by Chapter 17 on the GNOME desktop, Chapter 18 on the KDE desktop, and Chapter 19 on the fvwm2 window manager.

Our goal in producing this book is to provide convenience, and that means keeping the book (relatively) small. It certainly doesn't have everything the manual pages have; but you'll find that it has what you need 95% of the time.

(20)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.5 Sources and Licenses

Some distributions contain the source code for Linux; it is also easily available for download at

http://www.kernel.org and elsewhere. Source code is similarly available for all the utilities on Linux (unless your vendor offers a commercial application or library as a special enhancement). You may never bother looking at the source code, but it's key to Linux's strength. Under the Linux license, the source code has to be provided by the vendor, and it permits those who are competent at such things to fix bugs, provide advice about the system's functioning, and submit improvements that benefit everyone. The license is the GNU project's well-known General Public License, also known as the GPL or "copyleft," invented and popularized by the Free Software Foundation.

The FSF, founded by Richard Stallman, is a phenomenon that many people might believe to be impossible if it did not exist. (The same goes for Linux, in fact—15 years ago, who would have imagined a robust operating system developed by collaborators over the Internet and made freely redistributable?) One of the most popular editors on Unix, GNU Emacs, comes from the FSF. So do gcc and g++ (C and C++ compilers), which for a while set the standard in the industry for optimization and fast code. One of the largest projects within GNU is the GNOME desktop, which encompasses several useful general-purpose libraries and applications that use these libraries to provide consistent behavior and interoperability.

Dedicated to the sharing of software, the FSF provides all its code and documentation on the Internet and allows anyone with a whim for enhancements to alter the source code. One of its projects is the Debian distribution of Linux.

To prevent hoarding, the FSF requires that the source code for all enhancements be distributed under the same GPL that it uses. This encourages individuals or companies to make improvements and share them with others. The only thing someone cannot do is add enhancements and then try to sell the product as

commercial software—that is, to withhold the source code. That would be taking advantage of the FSF and the users. You can find the GPL in any software covered by that license, or online at

http://www.gnu.org/copyleft/gpl.html.

As we said earlier, many Linux tools come from BSD instead of GNU. BSD is also free software. The license is significantly different, but that probably don't concern you as a user. The effect of the difference is that companies are permitted to incorporate the software into their proprietary products, a practice that is severely limited by the GNU license.

(21)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.6 Beginner's Guide

If you're just beginning to work on a Linux system, the abundance of commands might prove daunting. To help orient you, the following lists present a sampling of commands on various topics.

1.6.1 Communication

ftp File Transfer Protocol. login Sign on.

rlogin Sign on to remote system.

rsh Run shell or single command on remote system (not particularly secure). ssh Run shell or single command on remote system (secure).

talk Exchange messages interactively with other terminals. telnet Connect to another system.

tftp Trivial File Transfer Protocol.

uudecode Decode file prepared for mailing by uuencode. uuencode Encode file containing binary characters for mailing. vacation Respond to mail automatically.

1.6.2 Comparisons

cmp Compare two files, byte by byte. comm Compare items in two sorted files. diff Compare two files, line by line. diff3 Compare three files.

(22)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

cat Concatenate files or display them.

chfn Change user information for finger, email, etc. cksum Compute checksum.

chmod Change access modes on files. chsh Change login shell.

cp Copy files.

csplit Split a file into pieces with a specific size or at specific locations. dd Copy files in raw disk form.

file Determine a file's type.

head Show the first few lines of a file. less Display files by screenful. ln Create filename aliases. ls List files or directories.

merge Merge changes from different files. mkdir Create a directory.

more Display files by screenful.

mv Move or rename files or directories. newgrp Change current group.

pwd Print working directory. rcp Copy files to remote system.

rm Remove files.

rmdir Remove directories. split Split files evenly.

tail Show the last few lines of a file. wc Count lines, words, and characters.

1.6.4 Media

cdda2wav Rip a CD to create a computer-friendly WAV format. cdparanoia Rip a CD while providing extra features.

cdrdao Copy a CD. cdrecord Record to a CD.

eject Eject a removable disk or tape. mpg321 Play an MP3 file.

(23)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

1.6.5 Printing

lpq Show status of print jobs. lpr Send to the printer. lprm Remove print job. lpstat Get printer status.

pr Format and paginate for printing.

1.6.6 Programming

ar Create and update library files. as Generate object file.

bison Generate parsing tables. cpp Preprocess C code. flex Lexical analyzer. g++ GNU C++ compiler. gcc GNU C compiler. ld Link editor. m4 Macro processor. make Create programs.

ranlib Regenerate archive symbol table. rpcgen Translate RPC to C code.

yacc Generate parsing tables.

(24)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

cvs Manage different versions (revisions) of source files.

etags Generate symbol list for use with the Emacs editor. gdb GNU debugger.

gprof Display object file's profile data.

imake Generate makefiles for use with make.

make Maintain, update, and regenerate related programs and files. nm Display object file's symbol table.

patch Apply patches to source code.

rcs Manage different versions (revisions) of source files. size Print the size of an object file in bytes.

strace Trace system calls and signals. strip Strip symbols from an object file.

1.6.8 Searching

apropos Search manpages for topic. egrep Extended version of grep. fgrep Search files for literal words.

find Search the system for files by name and take a range of possible actions. grep Search files for text patterns.

locate Search a preexisting database to show where files are on the system. strings Search binary files for text patterns.

whereis Find command.

1.6.9 Shell Programming

echo Repeat command-line arguments on the output. expr Perform arithmetic and comparisons.

printf Format and print command-line arguments. sleep Pause during processing.

test Test a condition.

(25)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

bzip2 Compress files to free up space.

cpio Create and unpack file archives. gunzip Expand compressed (.gz and .Z) files. gzip Compress files to free up space. shar Create shell archive.

tar Copy files to or restore files from an archive medium. zcat Display contents of compressed files.

1.6.11 System Status

at Execute commands later.

atq Show jobs queued by at.

atrm Remove job queued by at.

chgrp Change file group.

chown Change file owner.

crontab Automate commands.

date Display or set date.

df Show free disk space.

du Show disk usage.

env Show environment variables.

finger Display information about users.

kill Terminate a running command.

printenv Show environment variables.

ps Show processes.

stty Set or display terminal settings.

who Show who is logged in.

(26)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

col Process control characters.

cut Select columns for display.

emacs Work environment with powerful text editing capabilities. ex Line editor underlying vi.

expand Convert tabs to spaces.

fmt Produce roughly uniform line lengths.

fold Break lines.

gawk Process lines or records one by one. ghostscript Display PostScript or PDF file. groff Format troff input.

ispell Interactively check spelling.

join Merge different columns into a database. paste Merge columns or switch order.

rev Print lines in reverse. sed Noninteractive text editor. sort Sort or merge files. tac Print lines in reverse.

tr Translate (redefine) characters. uniq Find repeated or unique lines in a file.

vi Visual text editor.

xargs Process many arguments in manageable portions.

1.6.13 Miscellaneous

banner Make posters from words. bc Arbitrary precision calculator. cal Display calendar.

clear Clear the screen.

man Get information on a command. nice Reduce a job's priority.

nohup Preserve a running job after logging out. passwd Set your login password.

script Produce a transcript of your login session. su Become a superuser.

(27)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

(28)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

Chapter 2. System and Network Administration

Overview

Section 2.1. Common Commands Section 2.2. Overview of Networking Section 2.3. Overview of TCP/IP

Section 2.4. Overview of Firewalls and Masquerading Section 2.5. Overview of NFS

Section 2.6. Overview of NIS Section 2.7. Administering NIS Section 2.8. RPC and XDR

(29)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

2.1 Common Commands

Following are lists of commonly used system administration commands.

2.1.1 Clocks

hwclock Manage hardware clock.

rdate Get time from network time server. zdump Print list of time zones.

zic Create time conversion information files.

2.1.2 Daemons

apmd Advanced Power Management daemon. atd Queue commands for later execution. bootpd Internet Boot Protocol daemon. fingerd Finger daemon.

ftpd File Transfer Protocol daemon.

identd Identify user running TCP/IP process. imapd IMAP mailbox server daemon.

inetd Internet services daemon. klogd Manage syslogd.

lpd Printer daemon.

mountd NFS mount request server. named Internet domain name server.

nfsd NFS daemon.

pppd Maintain Point-to-Point Protocol (PPP) network connections. rdistd Remote file distribution server.

rexecd Remote execution server. rlogind rlogin server.

(30)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

sshd Secure shell daemon.

syslogd System logging daemon. talkd Talk daemon.

tcpd TCP network daemon.

tftpd Trivial File Transfer Protocol daemon. update Buffer flush daemon.

ypbind NIS binder process.

yppasswdd NIS password modification server. ypserv NIS server process.

2.1.3 Hardware

agetty Start user session at terminal.

arp Manage the ARP cache.

cardctl Control PCMCIA cards.

cardmgr PCMCIA card manager daemon.

cfdisk Maintain disk partitions (graphical interface). fdisk Maintain disk partitions.

hdparm Get and set hard drive parameters. kbdrate Manage the keyboard's repeat rate. ramsize Print information about RAM disk.

setkeycodes Change keyboard scancode-to-keycode mappings. setserial Set serial port information.

slattach Attach serial lines as network interfaces.

2.1.4 Host Information

arch Print machine architecture.

dig Query Internet domain name servers. Replaces nslookup. dnsdomainname Print DNS domain name.

domainname Print NIS domain name.

free Print memory usage.

host Print host and zone information. hostname Print or set hostname.

(31)

• Table of Contents

• Index

• Reviews

• Reader Reviews

• Errata

Linux in a Nutshell, 4th Edition

By Stephen Figgins, Ellen Siever, Aaron Weber

Publisher: O'Reilly Pub Date: June 2003

ISBN: 0-596-00482-6 Pages: 944

Slots: 1

Comprehensive but concise, Linux in a Nutshell is an essential desktop reference for the commands that users of Linux utilize every day. It covers all substantial user, programming, administration, and networking

commands for the most common Linux distributions. It's several quick references rolled into one: sed, gawk, RCS, CVS, vi, Emacs, bash, tcsh, regular expressions, package management, bootloaders, and desktop environments are all covered in this clear, to-the-point volume, along with core command-line utilities.

2.1.5 Installation

cpio Copy file archives.

install Copy files into locations providing user access and set permissions. rdist Distribute files to remote systems.

tar Copy files to or restore files from an archive medium.

2.1.6 Mail

fetchmail Retrieve mail from remote servers. formail Convert input to mail format. mailq Print a summary of the mail queue. makemap Update sendmail's database maps. rmail Handle uucp mail.

sendmail Send and receive mail.

2.1.7 Managing Filesystems

To Unix systems, a filesystem is a device (such as a partition) that is formatted to store files. Filesystems can be found on hard drives, floppies, CD-ROMs, or other storage media that permit random access.

The exact format and means by which the files are stored are not important; the system provides a common interface for all filesystem types that it recognizes. Under Linux, filesystem types include the Second Extended (ext2) Filesystem, which you probably use to store Linux files. This filesystem was developed primarily for Linux and support

Figure

Figure 2-1. Layers in the TCP/IP protocol architecture
Figure 2-2. IP address structure

References

Related documents