UNIX in a Nutshell: A Desktop Quick Reference for SVR 4 and Solaris 7


You may have seen Unix quick-reference guides, but you've never seen anything like UNIX in a Nutshell. Not a scaled-down quick reference of common commands, UNIX in a Nutshell is a complete reference containing all commands and options, along with generous descriptions and examples that put the commands in context. For all but the thorniest Unix problems, this one reference should be all the documentation you need.

The third edition of UNIX in a Nutshell includes thorough ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (105) from $1.99   
  • New (4) from $12.36   
  • Used (101) from $1.99   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
Seller since 2008

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.


Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2009

Feedback rating:


Condition: New
1565924274 *BRAND NEW* Ships Same Day or Next!

Ships from: Springfield, VA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Seller since 2014

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2014

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


You may have seen Unix quick-reference guides, but you've never seen anything like UNIX in a Nutshell. Not a scaled-down quick reference of common commands, UNIX in a Nutshell is a complete reference containing all commands and options, along with generous descriptions and examples that put the commands in context. For all but the thorniest Unix problems, this one reference should be all the documentation you need.

The third edition of UNIX in a Nutshell includes thorough coverage of System V Release 4. To that, author Arnold Robbins has added the latest information about:

  • Sixty new commands in The Alphabetical Summary of Commands
  • Solaris 7
  • Shell syntax (sh, csh, and the 1988 and 1993 versions of ksh)
  • Regular expression syntax
  • vi and ex commands, as well as newly updated Emacs information
  • sed and awk commands
  • troff and related commands and macros, with a new section on refer
  • make, RCS (version 5.7), and SCCS commands

In addition, there is a new Unix bibliography to guide the reader to further reading about the Unix environment.

If you currently use Unix SVR4, or if you're a Solaris user, you'll want this book. UNIX in a Nutshell is the most comprehensive quick reference on the market, a must for any Unix user.

Read More Show Less

Product Details

  • ISBN-13: 9781565924277
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 9/1/1999
  • Series: In a Nutshell (O'Reilly) Series
  • Edition description: Third Edition
  • Edition number: 3
  • Pages: 624
  • Product dimensions: 6.03 (w) x 8.99 (h) x 1.16 (d)

Meet the Author

Arnold Robbins, an Atlanta native, is a professional programmer and technical author. He has worked with Unix systems since 1980, when he was introduced to a PDP-11 running a version of Sixth Edition Unix. He has been a heavy AWK user since 1987, when he became involved with gawk, the GNU project's version of AWK. As a member of the POSIX 1003.2 balloting group, he helped shape the POSIX standard for AWK. He is currently the maintainer of gawk and its documentation. He is also coauthor of the sixth edition of O'Reilly's Learning the vi Editor. Since late 1997, he and his family have been living happily in Israel.

Read More Show Less

Read an Excerpt

Chapter 11: The awk Programming Language

11.1 Conceptual Overview

awk is a pattern-matching program for processing files, especially when they are databases. The new version of awk, called nawk, provides additional capabilities.1 Every modern Unix system comes with a version of new awk, and its use is recommended over old awk.

1 It really isn't so new. The additional features were added in 1984, and it was first shipped with System V Release 3.1 in 1987. Nevertheless, the name was never changed on most systems.

Different systems vary in what the two versions are called. Some have oawk and awk, for the old and new versions, respectively. Others have awk and nawk. Still others only have awk, which is the new version. This example shows what happens if your awk is the old one:

$ awk 1 /dev/null
awk: syntax error near line 1
awk: bailing out near line 1

awk exits silently if it is the new version.

Source code for the latest version of awk, from Bell Labs, can be downloaded starting at Brian Kernighan's home page: http://cm.bell-labs.com/~bwk. Michael Brennan's mawk is available via anonymous FTP from ftp://ftp.whidbey.net/pub/brennan/mawk1.3.3.tar.gz. Finally, the Free Software Foundation has a version of awk called gawk, available from ftp://gnudist.gnu.org/gnu/gawk/gawk-3.0.4.tar.gz. All three programs implement "new" awk. Thus, references below such as "nawk only," apply to all three. gawk has additional features.

With original awk, you can:

  • Think of a text file as made up of records and fields in a textual database.

  • Perform arithmetic and string operations.

  • Use programming constructs such as loops and conditionals.

  • Produce formatted reports.

With nawk, you can also:

  • Define your own functions.

  • Execute Unix commands from a script.

  • Process the results of Unix commands.

  • Process command-line arguments more gracefully.

  • Work more easily with multiple input streams.

  • Flush open output files and pipes (latest Bell Labs awk).

In addition, with GNU awk (gawk), you can:

  • Use regular expressions to separate records, as well as fields.

  • Skip to the start of the next file, not just the next record.

  • Perform more powerful string substitutions.

  • Retrieve and format system time values.

11.2 Command-Line Syntax

The syntax for invoking awk has two forms:

awk  [options]  'script'  var=value  file(s)
awk  [options]  -f scriptfile  var=value  file(s)

You can specify a script directly on the command line, or you can store a script in a scriptfile and specify it with -f. nawk allows multiple -f scripts. Variables can be assigned a value on the command line. The value can be a literal, a shell variable ($name), or a command substitution (`cmd`), but the value is available only after the BEGIN statement is executed.

awk operates on one or more files. If none are specified (or if - is specified), awk reads from the standard input.

The recognized options are:


Set the field separator to fs. This is the same as setting the system variable FS. Original awk allows the field separator to be only a single character. nawk allows fs to be a regular expression. Each input line, or record, is divided into fields by whitespace (blanks or tabs) or by some other user-definable record separator. Fields are referred to by the variables $1, $2,..., $n. $0 refers to the entire record.

-v var=value

Assign a value to variable var. This allows assignment before the script begins execution (available in nawk only).

To print the first three (colon-separated) fields of each record on separate lines:

awk -F: '{ print $1; print $2; print $3 }' /etc/passwd

More examples are shown in the section "Simple Pattern-Procedure Examples."

11.3 Patterns and Procedures

awk scripts consist of patterns and procedures:

pattern  { procedure }

Both are optional. If pattern is missing, { procedure } is applied to all lines; if { procedure } is missing, the matched line is printed.

11.3.1 Patterns

A pattern can be any of the following:

/regular expression/
relational expression
pattern-matching expression
  • Expressions can be composed of quoted strings, numbers, operators, functions, defined variables, or any of the predefined variables described later in the section "Built-in Variables."

  • Regular expressions use the extended set of metacharacters and are described in Chapter 6, Pattern Matching.

  • ^ and $ refer to the beginning and end of a string (such as the fields), respectively, rather than the beginning and end of a line. In particular, these metacharacters will not match at a newline embedded in the middle of a string.

  • Relational expressions use the relational operators listed in the section "Operators" later in this chapter. For example, $2 > $1 selects lines for which the second field is greater than the first. Comparisons can be either string or numeric. Thus, depending on the types of data in $1 and $2, awk does either a numeric or a string comparison. This can change from one record to the next.

  • Pattern-matching expressions use the operators ~ (match) and !~ (don't match). See the section "Operators" later in this chapter.

  • The BEGIN pattern lets you specify procedures that take place before the first input line is processed. (Generally, you set global variables here.)

  • The END pattern lets you specify procedures that take place after the last input record is read.

  • In nawk, BEGIN and END patterns may appear multiple times. The procedures are merged as if there had been one large procedure.

Except for BEGIN and END, patterns can be combined with the Boolean operators || (or), && (and), and ! (not). A range of lines can also be specified using comma-separated patterns:


11.3.2 Procedures

Procedures consist of one or more commands, functions, or variable assignments, separated by newlines or semicolons, and contained within curly braces. Commands fall into five groups:

  • Variable or array assignments

  • Printing commands

  • Built-in functions

  • Control-flow commands

  • User-defined functions (nawk only)

11.3.3 Simple Pattern-Procedure Examples

  • Print first field of each line:

    { print $1 }

  • Print all lines that contain pattern:


  • Print first field of lines that contain pattern:

    /pattern/ { print $1 }

  • Select records containing more than two fields:

    NF > 2

  • Interpret input records as a group of lines up to a blank line. Each line is a single field:

    BEGIN { FS = "\n"; RS = "" }

  • Print fields 2 and 3 in switched order, but only on lines whose first field matches the string "URGENT":

    $1 ~ /URGENT/ { print $3, $2 }

  • Count and print the number of pattern found:

    /pattern/ { ++x }
    END { print x }

  • Add numbers in second column and print total:

    { total += $2 }
    END { print "column total is", total}

  • Print lines that contain less than 20 characters:

    length($0) < 20

  • Print each line that begins with Name: and that contains exactly seven fields:

    NF == 7 && /^Name:/

  • Print the fields of each input record in reverse order, one per line:

            for (i = NF; i >= 1; i--)
                    print $i

11.4 Built-in Variables

Version Variable Description

Current filename


Field separator (a space)


Number of fields in current record


Number of the current record


Output format for numbers ("%.6g") and for conversion to string


Output field separator (a space)


Output record separator (a newline)


Record separator (a newline)


Entire input record


nth field in current record; fields are separated by FS

nawk ARGC

Number of arguments on command line


An array containing the command-line arguments, indexed from 0 to ARGC - 1


String conversion format for numbers ("%.6g") (POSIX)


An associative array of environment variables


Like NR, but relative to the current file


Length of the string matched by match() function


First position in the string matched by match() function


Separator character for array subscripts ("\034")


Index in ARGV of current input file


A string indicating the error when a redirection fails for getline or if close() fails


A space-separated list of field widths to use for splitting up the record, instead of FS


When true, all regular expression matches, string comparisons, and calls to index()s ignore case


The text matched by RS, which can be a regular expression in gawk

11.5 Operators

The following table lists the operators, in order of increasing precedence, that are available in awk. Note: while ** and **= are common extensions, they are not part of POSIX awk.

Symbol Meaning

= += -= *= /= %= ^= **=

?: C conditional expression (nawk only)
|| Logical OR (short-circuit)
&& Logical AND (short-circuit)
in Array membership (nawk only)
~ !~ Match regular expression and negation
< <= > >= != == Relational operators
(blank) Concatenation
+ - Addition, subtraction
* / % Multiplication, division, and modulus (remainder)
+ - ! Unary plus and minus, and logical negation
^ ** Exponentiation
++ -- Increment and decrement, either prefix or postfix
$ Field reference

11.6 Variables and Array Assignments

Variables can be assigned a value with an = sign. For example:

FS = ","

Expressions using the operators +, -, /, and % (modulo) can be assigned to variables.

Arrays can be created with the split() function (see below), or they can simply be named in an assignment statement. Array elements can be subscripted with numbers (array[1], ..., array[n]) or with strings. Arrays subscripted by strings are called associative arrays.2 For example, to count the number of widgets you have, you could use the following script:

2 In fact, all arrays in awk are associative; numeric subscripts are converted to strings before using them as array subscripts. Associative arrays are one of awk's most powerful features.

/widget/ { count["widget"]++ }               Count widgets
END      { print count["widget"] }            Print the count

You can use the special for loop to read all the elements of an associative array:

for (item in array)
        process array[item]

The index of the array is available as item, while the value of an element of the array can be referenced as array[item].

You can use the operator in to see if an element exists by testing to see if its index exists (nawk only):

if (index in array)

This sequence tests that array[index] exists, but you cannot use it to test the value of the element referenced by array[index].

You can also delete individual elements of the array using the delete statement (nawk only).

11.6.1 Escape Sequences

Within string and regular expression constants, the following escape sequences may be used. Note: The \x escape sequence is a common extension; it is not part of POSIX awk.

Sequence Meaning Sequence Meaning
\a Alert (bell) \v Vertical tab
\b Backspace \\ Literal backslash
\f Form feed \nnn Octal value nnn
\n Newline \xnn Hexadecimal value nn
\r Carriage return \" Literal double quote (in strings)
\t Tab \/ Literal slash (in regular expressions)

11.7 User-Defined Functions

nawk allows you to define your own functions. This makes it easy to encapsulate sequences of steps that need to be repeated into a single place, and reuse the code from anywhere in your program. Note: for user-defined functions, no space is allowed between the function name and the left parenthesis when the function is called.

The following function capitalizes each word in a string. It has one parameter, named input, and five local variables, which are written as extra parameters.

# capitalize each word in a string
function capitalize(input,    result, words, n, i, w)
        result = ""
        n = split(input, words, " ")
        for (i = 1; i <= n; i++) {
                w = words[i]
                w = toupper(substr(w, 1, 1)) substr(w, 2)
                if (i > 1)
                        result = result " "
                result = result w
        return result

# main program, for testing
{ print capitalize($0) }

With this input data:

A test line with words and numbers like 12 on it.

This program produces:

A Test Line With Words And Numbers Like 12 On It.

11.8 Group Listing of awk Functions and Commands

The following table classifies awk functions and commands.

Arithmetic String Control Flow I/O Time Program-
Functions Functions Statements Processing Functions ming
atan2[3] gensub[4] break close[3] delete[3]
cos[3] gsub[3] continue fflush[5] systime[4] function[3]
exp index do/while[3] getline[3]   system[3]
int length exit next    
log match[3] for nextfile[5]    
rand[3] split if print    
sin[3] sprintf return[3] printf    
sqrt sub[3] while      
srand[3] substr        

[3] Available in nawk.

[4] Available in gawk.

[5] Available in Bell Labs awk and gawk.

11.9 Implementation Limits

Many versions of awk have various implementation limits, on things such as:

  • Number of fields per record

  • Number of characters per input record

  • Number of characters per output record

  • Number of characters per field

  • Number of characters per printf string

  • Number of characters in literal string

  • Number of characters in character class

  • Number of files open

  • Number of pipes open

  • The ability to handle 8-bit characters and characters that are all zero (ASCII NUL)

gawk does not have limits on any of these items, other than those imposed by the machine architecture and/or the operating system.

11.10 Alphabetical Summary of Functions and Commands

The following alphabetical list of keywords and functions includes all that are available in awk, nawk, and gawk. nawk includes all old awk functions and keywords, plus some additional ones (marked as {N}). gawk includes all nawk functions and keywords, plus some additional ones (marked as {G}). Items marked with {B} are available in the Bell Labs awk. Items that aren't marked with a symbol are available in all versions....

Read More Show Less

Table of Contents

Scope of This Book;
How to Contact Us;
Commands and Shells;
Chapter 1: Introduction;
1.1 Merging the Traditions;
1.2 Bundling;
1.3 What’s in the Quick Reference;
1.4 Beginner’s Guide;
1.5 Guide for Users of BSD-Derived Systems;
1.6 Solaris: Standard Compliant Programs;
Chapter 2: Unix Commands;
2.1 Alphabetical Summary of Commands;
Chapter 3: The Unix Shell: An Overview;
3.1 Introduction to the Shell;
3.2 Purpose of the Shell;
3.3 Shell Flavors;
3.4 Common Features;
3.5 Differing Features;
Chapter 4: The Bourne Shell and Korn Shell;
4.1 Overview of Features;
4.2 Syntax;
4.3 Variables;
4.4 Arithmetic Expressions;
4.5 Command History;
4.6 Job Control;
4.7 Invoking the Shell;
4.8 Restricted Shells;
4.9 Built-in Commands (Bourne and Korn Shells);
Chapter 5: The C Shell;
5.1 Overview of Features;
5.2 Syntax;
5.3 Variables;
5.4 Expressions;
5.5 Command History;
5.6 Job Control;
5.7 Invoking the Shell;
5.8 Built-in C Shell Commands;
Text Editing and Processing;
Chapter 6: Pattern Matching;
6.1 Filenames Versus Patterns;
6.2 Metacharacters, Listed by Unix Program;
6.3 Metacharacters;
6.4 Examples of Searching;
Chapter 7: The Emacs Editor;
7.1 Introduction;
7.2 Summary of Commands by Group;
7.3 Summary of Commands by Key;
7.4 Summary of Commands by Name;
Chapter 8: The vi Editor;
8.1 Review of vi Operations;
8.2 Movement Commands;
8.3 Edit Commands;
8.4 Saving and Exiting;
8.5 Accessing Multiple Files;
8.6 Interacting with Unix;
8.7 Macros;
8.8 Miscellaneous Commands;
8.9 Alphabetical List of Keys;
8.10 Setting Up vi;
Chapter 9: The ex Editor;
9.1 Syntax of ex Commands;
9.2 Alphabetical Summary of ex Commands;
Chapter 10: The sed Editor;
10.1 Conceptual Overview;
10.2 Command-Line Syntax;
10.3 Syntax of sed Commands;
10.4 Group Summary of sed Commands;
10.5 Alphabetical Summary of sed Commands;
Chapter 11: The awk Programming Language;
11.1 Conceptual Overview;
11.2 Command-Line Syntax;
11.3 Patterns and Procedures;
11.4 Built-in Variables;
11.5 Operators;
11.6 Variables and Array Assignments;
11.7 User-Defined Functions;
11.8 Group Listing of awk Functions and Commands;
11.9 Implementation Limits;
11.10 Alphabetical Summary of Functions and Commands;
Text Formatting;
Chapter 12: nroff and troff;
12.1 Introduction;
12.2 Command-Line Invocation;
12.3 Conceptual Overview;
12.4 Default Operation of Requests;
12.5 Group Summary of Requests;
12.6 Alphabetical Summary of Requests;
12.7 Escape Sequences;
12.8 Predefined Registers;
12.9 Special Characters;
Chapter 13: mm Macros;
13.1 Alphabetical Summary of mm Macros;
13.2 Predefined String Names;
13.3 Number Registers Used in mm;
13.4 Other Reserved Macro and String Names;
13.5 Sample Document;
Chapter 14: ms Macros;
14.1 Alphabetical Summary of ms Macros;
14.2 Number Registers for Page Layout;
14.3 Reserved Macro and String Names;
14.4 Reserved Number Register Names;
14.5 Sample Document;
Chapter 15: me Macros;
15.1 Alphabetical Summary of me Macros;
15.2 Predefined Strings;
15.3 Predefined Number Registers;
15.4 Sample Document;
Chapter 16: man Macros;
16.1 Alphabetical Summary of man Macros;
16.2 Predefined Strings;
16.3 Internal Names;
16.4 Sample Document;
Chapter 17: troff Preprocessors;
17.1 tbl;
17.2 eqn;
17.3 pic;
17.4 refer;
Software Development;
Chapter 18: The Source Code Control System;
18.1 Introduction;
18.2 Overview of Commands;
18.3 Basic Operation;
18.4 Identification Keywords;
18.5 Data Keywords;
18.6 Alphabetical Summary of SCCS Commands;
18.7 sccs and Pseudo-Commands;
Chapter 19: The Revision Control System;
19.1 Overview of Commands;
19.2 Basic Operation;
19.3 General RCS Specifications;
19.4 Conversion Guide for SCCS Users;
19.5 Alphabetical Summary of Commands;
Chapter 20: The make Utility;
20.1 Conceptual Overview;
20.2 Command-Line Syntax;
20.3 Description File Lines;
20.4 Macros;
20.5 Special Target Names;
20.6 Writing Command Lines;
20.7 Sample Default Macros, Suffixes, and Rules;
ASCII Character Set;
Obsolete Commands;
Alphabetical Summary of Commands;

Read More Show Less


The third edition of UNIX in a Nutshell (for System V) generally follows the dictum that "if it's not broken, don't fix it." This edition has the following new features:
  • Many mistakes and typographical errors have been fixed.
  • Coverage of Solaris 7, the latest version of the SVR4-based operating system from Sun Microsystems.
  • Coverage of over 50 new commands has been added, mostly in Chapter 2.
  • The Korn shell chapter now covers both the 1988 and the 1993 versions of ksh.
  • The Emacs chapter now covers GNU emacs version 20.
  • A new chapter describes the troff man macros.
  • Each chapter on the troff macro packages comes with a simple example document showing the order in which to use the macros.
  • The troff preprocessors chapter now covers refer and its related programs.
  • The RCS chapter now covers version 5.7 of RCS.
  • A new "UNIX Bibliography" chapter lists books that every UNIX Wizard should have on his or her bookshelf
  • Coverage of commands that are no longer generally useful but that still come with SVR4 or Solaris have been moved to an appendix.


This quick reference should be of interest to UNIX users and UNIX programmers, as well as to anyone (such as a system administrator) who might offer direct support to users and programmers. The presentation is geared mainly toward people who are already familiar with the UNIX system - that is, you know what you want to do, and you even have some idea how to do it. You just need a reminder about the details. For example, if you want to remove the third field from a database, you might think, "I know I can use the cut command, but what arethe options?" In many cases, specific examples are provided to show how a command is used.

This quick reference might also help people who are familiar with some aspects of UNIX but not with others. Many chapters include an overview of the particular topic. White this isn't meant to be comprehensive, it's usually sufficient to get you started in unfamiliar territory.

And some of you may be coming from a UNIX system that runs the BSD or SunOS 4.1 version. To help with such a transition, SVR4 and Solaris include a group of "compatibility" commands, many of which are presented in this guide.

Finally, if you're new to the UNIX operating system, and you're feeling bold, you might appreciate this book as a quick tour of what UNIX has to offer. Section 1-4, Beginner's Guide, can point you to the most useful commands, and you'll find brief examples of how to use them, but take note: this book should not be used in place of a good beginner's tutorial on UNIX. (You might try Learning the UNIX Operating System for that.) This quick reference should be a supplement, not a substitute. (There are references throughout the text to other relevant O'Reilly books that will help you learn the subject matter under discussionyou may be better off detouring to those books first.)

Scope of This Book

The quick reference is divided into five parts:

  • Part I (Chapters I through 5) describes the syntax and options for UNIX commands and for the Bourne, Kom, and C shells.
  • Part II (Chapters 6 through 11) presents various editing tools and describes their command set (alphabetically and by group). Part 11 begins with a review of pattern matching, inducting examples geared toward specific editors.
  • Part III (Chapters 12 through 17) describes the nroff and troff text formatting programs, related macro packages, and the preprocessors tbl, eqn, pic, and refer.
  • Part IV (Chapters 18 through 20) summarizes the UNIX utilities for software development - SCCS, RCS, and make.
  • Part V contains loose ends: a cable of ASCII characters and equivalent values, a bibliography of UNIX books, and an appendix that covers obsolete commands that are still part of SVR4 and/or Solaris.


The quick reference follows certain typographic conventions, outlined below:

Constant Width

is used for directory names, filenames, commands, and options. All terms shown in constant width are typed literally. It is also used to show the contents of files or the out- put from commands.

Constant Italic
is used in syntax and command summaries to show generic text; these should be replaced with user-supplied values.

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

is used to show generic arguments and options; these should be replaced with user-supplied values. Italic is also used to highlight comments in examples.

Bold Italic
is used for headings.

is used for summary headings, such as in the command summary chapter.

%, $ are used in some examples as the C shell prompt (%) and as the Bourne shell or Kom shell prompt ($).
?, > are used in some examples as the C shell secondary prompt (?) and as the Bourne shell or Kom shell secondary prompt (>).
program(N) indicates the "man page" for program in section IV of the online manual. For example, echo(1) means the entry for the echo command.
[ ] surround optional elements in a description of syntax. (Me brackets themselves should never be typed.) Note that many commands show the argument [files]. If a filename is omitted, standard input (usually the keyboard) is assumed. End keyboard input with an end-of-file character.
indicates the end-of-file character (normally CTRL-D).
^x, CTRL-x
indicates a "control character," typed by holding down the CONTROL key and the x key for any key x.
| is used in syntax descriptions to separate items for which only one alternative may be chosen at a time.
---> is used at the bottom of a right-hand page to show that the current entry continues on the next page. The continuation is marked by a <---.

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.


Thanks to Yosef Gold for letting me share his office, allowing me to work efficiently and productively. Deb Cameron revised Chapter 7, The Emacs Editor. Thanks to Gigi Escabrook at O'Reilly & Associates for her help and support.

Good reviewers make for good books, even though they also make for more work for the author. I would like to thank Glenn Barry (Sun Microsystems) for a number of helpful comments. Nelson H. F. Beebe (University of Utah Department of Mathematics) went through the book with a fine-tooth comb; it is greatly improved for his efforts. A special thanks to Brian Kernighan (Bell Labs) for his review and comments. The troff-related chapters in particular benefited from his authority and expertise, as did the rest of the book (not to mention much of UNIX!). Nelson H. F. Beebe and Dennis Ritchie (Bell Labs) provided considerable help in putting together Chapter 22, A UNIX Bibliography.

Finally, much thanks to my wonderful wife Miriam; without her love and support this project would not have been possible.

Arnold Robbins
Nof Ayalon, ISRAEL
March, 1999

Acknowledgments From the Second Edition

Many people helped this book along the way. The first edition resulted from the efforts of the following staff members of O'Reilly & Associates: Jean Diaz, Dale Dougherty, Daniel Gilly, Linda Mui, Tim O'Reilly, Thomas Van Raalte, Linda Walsh, Sue Willing, and Donna Woonteiler.

The second edition has a new cover and new interior layout, designed by Edie Freedman. Arthur Saarinen drew the referee figures. Chris Reilley and Jeff Robbins assisted with graphics. The manuscript was formatted using troff macros that were implemented by Linda Mui and Lenny Muellner, and the manuscript was prepared through the efforts of Donna Woontelier, Sue Willing, and especially Rosanne Wagger. Christine Kenney and Peter Mui were valuable resources, tracking down useful information and passing it along.

Special thanks to the technical reviewers for reading the drafts and fielding all kinds of questions; the book has profited greatly from the comments of Tan Bronson (Microvation Consultants), Peter van der Linden, and Mike Loukides (O'Reilly & Associates).

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.
101 Morris Street
Sebastopol, CA 95472
1-800-998-9938 (in the US or Canada)
1-707-829-0515 (intemational/local)
1-707-829-0104 (FAX)

You can also send us messages electronically. To be put on the mailing list or request a catalog, send email to:


To ask technical questions or comment on the book, send email to:


Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted February 17, 2004

    Everyone in the Office Has a Copy

    Once I borrowed this book from my cubemate I realized why everyone in the office had a copy. This book is the best UNIX reference I have ever seen!

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted April 5, 2001

    Very useful reference

    This is a very useful book. It provides easy and quick access to UNIX features and programs that are often used when working with this OS; such as RCS, SCCS, and Emacs. The discussion about different UNIX shell environments (ksh, csh is very readable).

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted September 24, 2000

    Excellent Intro and Resource

    Once again O'Reilly & Associates has produced a succinct and informative overview of a computer topic. Provides useful commands, tips, and gotchas that would help novice and journeyman alike.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 7, 2000

    Better than Manpages!

    I bought an earlier version of this book in 1994 to help me in a temporary job where I was editing manpages. It proved to be a major help. This new edition not only provides existing information, but also covers the newest UNIX OS's. This book contains chapters on a variety of topics, including various shells, vi commands, emacs, various text formatting macros, awk, as well as almost 200 pages on UNIX commands! An indispensable reference tool, one that I refer to often when working in UNIX. All commands are listed alphabetically, which makes this book something like a 'UNIX dictionary.' Well worth the money if you already know something about UNIX and want to learn more.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)