Thông tin tài liệu
www.it-ebooks.info
www.it-ebooks.info
UNIX
IN A NUTSHELL
,TITLE.12845 Page i Tuesday, August 22, 2006 4:51 PM
www.it-ebooks.info
Other resources from O’Reilly
Related titles
Classic Shell Scripting
Effective awk
Programming
Essential CVS
Essential System
Administration
GDB Pocket Reference
Learning GNU Emacs
Learning the bash Shell
Learning the Korn Shell
Learning the vi Editor
Linux in a Nutshell
Mac OS X Tiger for Unix
Geeks
Managing Projects with
GNU Make
Running Linux
sed and awk Pocket
Reference
TCP/IP Network
Administration
The Complete FreeBSD
Unix Power Tools
Using csh & tcsh
Version Control with
Subversion
oreilly.com
oreilly.com is more than a complete catalog of O’Reilly
books. You'll also find links to news, events, articles,
weblogs, sample chapters, and code examples.
Conferences
O’Reilly brings diverse innovators together to nurture the
ideas that spark revolutionary industries. We specialize in
documenting the latest tools and systems, translating the
innovator’s knowledge into useful skills for those in the
trenches. Visit conferences.oreilly.com for our upcoming
events.
Safari Bookshelf (safari.oreilly.com) is the premier online
reference library for programmers and IT professionals.
Conduct searches across more than 1,000 books. Sub-
scribers can zero in on answers to time-critical questions
in a matter of seconds. Read the books on your Book-
shelf from cover to cover or simply flip to the page you
need. Try it today for free.
,TITLE.12845 Page ii Tuesday, August 22, 2006 4:51 PM
www.it-ebooks.info
Fourth Edition
UNIX
IN A NUTSHELL
Arnold Robbins
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
,TITLE.12845 Page iii Tuesday, August 22, 2006 4:51 PM
www.it-ebooks.info
Unix in a Nutshell, Fourth Edition
by Arnold Robbins
Copyright © 2006, 1999, 1992, 1989 O’Reilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles (safari.oreilly.com). For more information, contact
our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Editor:
Mike Loukides
Production Editor:
Colleen Gorman
Cover Designer:
Edie Freedman
Interior Designer:
David Futato
Back Cover Illustration:
J.D. “Illiad” Frazer
Printing History:
May 1989: First Edition.
June 1992: Second Edition.
August 1999: Third Edition.
October 2005: Fourth Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered
trademarks of O’Reilly Media, Inc. The In a Nutshell series designations, Unix in a Nutshell,
the image of a tarsier, and related trade dress are trademarks of O’Reilly Media, 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 Media,
Inc. was aware of a trademark claim, the designations have been printed in caps or initial
caps. UNIX is a registered trademark of The Open Group.
While every precaution has been taken in the preparation of this book, the publisher and
author assume no responsibilityfor errors or omissions, or for damages resulting from the use
of the information contained herein.
ISBN: 0-596-10029-9
[M] [8/06]
,COPYRIGHT.12974 Page iv Tuesday, August 22, 2006 4:52 PM
www.it-ebooks.info
To my wife, Miriam. May our dreams continue to come true.
To my children, Chana, Rivka, Nachum, and Malka.
To the memory of Frank Willison.
www.it-ebooks.info
www.it-ebooks.info
vii
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Chapter 1
Table of Contents
Preface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xiii
Part I. Commands and Shells
1. Introduction
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
Unix in the 21st Century 3
Obtaining Compilers 5
Building Software 6
What’s in the Quick Reference 7
Beginner’s Guide 8
Solaris: Standard Compliant Programs 11
2. Unix Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
Introduction 13
Alphabetical Summary of Common Commands 15
Alphabetical Summary of Solaris Commands 241
Alphabetical Summary of GNU/Linux Commands 260
Alphabetical Summary of Mac OS X Commands 304
Alphabetical Summary of Java Commands 321
3. The Unix Shell: An Overview
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
341
Introduction to the Shell 341
Purpose of the Shell 342
Shell Flavors 343
www.it-ebooks.info
viii
|
Table of Contents
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Shell Source Code URLs 344
Common Features 344
Differing Features 345
4. The Bash and Korn Shells
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
347
Overview of Features 348
Invoking the Shell 349
Syntax 350
Functions 357
Variables 358
Arithmetic Expressions 366
Command History 368
Job Control 372
Command Execution 372
Restricted Shells 373
Built-in Commands (Bash and Korn Shells) 374
5. tcsh: An Extended C Shell
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
417
Overview of Features 417
Invoking the Shell 418
Syntax 419
Variables 423
Expressions 435
Command History 438
Command-Line Manipulation 442
Job Control 445
Built-in Commands 446
6. Package Management
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
467
Linux Package Management 467
The Red Hat Package Manager 470
Yum: Yellowdog Updater Modified 484
up2date: Red Hat Update Agent 489
The Debian Package Manager 492
Mac OS X Package Management 520
Solaris Package Management 521
www.it-ebooks.info
[...]... permission to adapt material from Essential CVS for Chapter 14 Similarly, Ben Collins-Sussman, Brian W Fitzpatrick, and C Michael Pilato gave permission for me to adapt material from Version Control with Subversion for Chapter 15, which I greatly appreciate And thanks to Andy Oram, Ellen Siever, Stephen Figgins and Aaron Weber for making available material from Linux in a Nutshell for use in parts of the... Associates, Inc All rights reserved | 7 The summary of Unix commands in Chapter 2 makes up a large part of this book Only user/programmer commands are included; administrative commands are purposely ignored Chapter 2 describes the following set: • Commands and options in Solaris, GNU/Linux, and Mac OS X This includes many “essential” tools for which source and/or binaries are available via the Internet • Solaris-only... these commands appear in the “Commands” section of the online manual With rare exception, this book purposely avoids system administration commands, because system administration is beyond its scope The focus instead is on everyday commands, those used both interactively and for programming Summarizing three operating systems that are similar but not identical is a daunting task In order to make a coherent... than does the SPARC version As mentioned earlier, on Solaris, we recommend placing /usr/xpg6/bin and /usr/xpg4/ bin in your PATH before /usr/bin aclocal aclocal [options] Part of GNU automake Place m4 macro definitions needed by autoconf into a single file The aclocal command first scans for macro definitions in m4 files in its default directory (/usr/share/ aclocal on some systems) and in the file acinclude.m4... & Associates, Inc All rights reserved I Commands and Shells Part I presents a summary of Unix commands of interest to users and programmers It also describes the major Unix shells, including special syntax and built -in commands It rounds off with an overview of package management software Chapter 1, Introduction Chapter 2, Unix Commands Chapter 3, The Unix Shell: An Overview Chapter 4, The Bash and... www.it-ebooks.info Copyright © 2006 O’Reilly & Associates, Inc All rights reserved GNU/Linux Commands This section lists the important commands that are available only on GNU/ Linux Mac OS X Commands This section lists the important commands that are available only on Mac OS X Java Commands The primary commands for doing Java development These are (essentially) the same across all systems Even commands that appear... instead Typographic conventions for describing command syntax are listed in the Preface For additional help in locating commands, see the Index Finding Commands on Solaris Solaris systems provide a number of “bin” directories underneath /usr for different kinds of commands For example, /usr/bin holds most regular commands, /usr/java/bin has the Java commands, and so on The bin directories are summarized... sophisticated interactive pager program for looking at information on a terminal, one screenful (or “page”) at a time The name is a pun on the more program Create filename aliases Find a file somewhere on the system based on its name The program uses a database of files that is usually automatically rebuilt, nightly List files or directories Print a file checksum using the Message Digest 5 (MD5) algorithm Create... systems make the transition to SVR4 Unix in the 21st Century Today, the specification of what makes a system Unix is embodied primarily in the POSIX standard, an international standard based on System V and BSD Commercial Unix systems, such as Solaris from Sun Microsystems, AIX from IBM, and HP-UX from Hewlett Packard, are standard-adhering direct descendants of the original Unix systems A number... original BSD C shell The “Tenex” C shell: a much-enhanced version of csh csh tcsh Shell Programming basename dirname echo expr id line printf sleep test 10 | Print the last component of a pathname, optionally removing a suffix Print all but the last component of a pathname Repeat command-line arguments on the output Perform arithmetic and comparisons Print user and group ID and name information Read a . book, and O’Reilly Media,
Inc. was aware of a trademark claim, the designations have been printed in caps or initial
caps. UNIX is a registered trademark. which I greatly appreciate. And thanks to Andy
Oram, Ellen Siever, Stephen Figgins and Aaron Weber for making available mate-
rial from Linux in a Nutshell
Ngày đăng: 22/02/2014, 09:20
Xem thêm: Tài liệu UNIX IN A NUTSHELL ppt, Tài liệu UNIX IN A NUTSHELL ppt