Unix in a Nutshell, 4th Edition

Book description

As an open operating system, Unix can be improved on by anyone and everyone: individuals, companies, universities, and more. As a result, the very nature of Unix has been altered over the years by numerous extensions formulated in an assortment of versions. Today, Unix encompasses everything from Sun's Solaris to Apple's Mac OS X and more varieties of Linux than you can easily name.

The latest edition of this bestselling reference brings Unix into the 21st century. It's been reworked to keep current with the broader state of Unix in today's world and highlight the strengths of this operating system in all its various flavors.

Detailing all Unix commands and options, the informative guide provides generous descriptions and examples that put those commands in context. Here are some of the new features you'll find in Unix in a Nutshell, Fourth Edition:

  • Solaris 10, the latest version of the SVR4-based operating system, GNU/Linux, and Mac OS X
  • Bash shell (along with the 1988 and 1993 versions of ksh)
  • tsch shell (instead of the original Berkeley csh)
  • Package management programs, used for program installation on popular GNU/Linux systems, Solaris and Mac OS X
  • GNU Emacs Version 21
  • Introduction to source code management systems
  • Concurrent versions system
  • Subversion version control system
  • GDB debugger

As Unix has progressed, certain commands that were once critical have fallen into disuse. To that end, the book has also dropped material that is no longer relevant, keeping it taut and current.

If you're a Unix user or programmer, you'll recognize the value of this complete, up-to-date Unix reference. With chapter overviews, specific examples, and detailed command.

Publisher resources

View/Submit Errata

Table of contents

  1. Dedication
  2. Preface
    1. Audience
    2. Scope of This Book
    3. Conventions
    4. Using Code Examples
    5. Safari® Enabled
    6. How to Contact Us
    7. Acknowledgments
  3. I. Commands and Shells
    1. 1. Introduction
      1. 1.1. Unix in the 21st Century
      2. 1.2. Obtaining Compilers
        1. 1.2.1. Solaris
        2. 1.2.2. GNU/Linux
        3. 1.2.3. Mac OS X
      3. 1.3. Building Software
      4. 1.4. What’s in the Quick Reference
      5. 1.5. Beginner’s Guide
        1. 1.5.1. Communication
        2. 1.5.2. Comparisons
        3. 1.5.3. File Management
        4. 1.5.4. Miscellaneous
        5. 1.5.5. Printing (BSD Commands)
        6. 1.5.6. Printing (System V Commands)
        7. 1.5.7. Programming
        8. 1.5.8. Searching
        9. 1.5.9. Shells
        10. 1.5.10. Shell Programming
        11. 1.5.11. Storage
        12. 1.5.12. System Status
        13. 1.5.13. Text Processing
      6. 1.6. Solaris: Standard Compliant Programs
    2. 2. Unix Commands
      1. 2.1. Introduction
        1. 2.1.1. Finding Commands on Solaris
        2. 2.1.2. Finding Commands on GNU/Linux and Mac OS X
      2. 2.2. Alphabetical Summary of Common Commands
      3. 2.3. Alphabetical Summary of Solaris Commands
      4. 2.4. Alphabetical Summary of GNU/Linux Commands
      5. 2.5. Alphabetical Summary of Mac OS X Commands
      6. 2.6. Alphabetical Summary of Java Commands
    3. 3. The Unix Shell: An Overview
      1. 3.1. Introduction to the Shell
      2. 3.2. Purpose of the Shell
        1. 3.2.1. Interactive Use
        2. 3.2.2. Customization of Your Unix Session
        3. 3.2.3. Programming
      3. 3.3. Shell Flavors
        1. 3.3.1. Which Shell Do I Want?
      4. 3.4. Shell Source Code URLs
      5. 3.5. Common Features
      6. 3.6. Differing Features
    4. 4. The Bash and Korn Shells
      1. 4.1. Overview of Features
      2. 4.2. Invoking the Shell
        1. 4.2.1. Options
          1. 4.2.1.1. Common options
          2. 4.2.1.2. Bash options
        2. 4.2.2. Arguments
      3. 4.3. Syntax
        1. 4.3.1. Special Files
        2. 4.3.2. Filename Metacharacters
          1. 4.3.2.1. Examples
        3. 4.3.3. Quoting
          1. 4.3.3.1. Examples
        4. 4.3.4. Command Forms
          1. 4.3.4.1. Examples
        5. 4.3.5. Redirection Forms
          1. 4.3.5.1. Simple redirection
          2. 4.3.5.2. Redirection using file descriptors
          3. 4.3.5.3. Multiple redirection
          4. 4.3.5.4. Examples
        6. 4.3.6. Coprocesses
          1. 4.3.6.1. Examples
      4. 4.4. Functions
      5. 4.5. Variables
        1. 4.5.1. Variable Substitution
          1. 4.5.1.1. Examples
        2. 4.5.2. Built-in Shell Variables
        3. 4.5.3. Other Shell Variables
        4. 4.5.4. Arrays
        5. 4.5.5. Discipline Functions (ksh93 Only)
        6. 4.5.6. Special Prompt Strings
      6. 4.6. Arithmetic Expressions
        1. 4.6.1. Operators
        2. 4.6.2. Built-in Mathematical Functions (ksh93 Only)
        3. 4.6.3. Examples
      7. 4.7. Command History
        1. 4.7.1. Line-Edit Mode
          1. 4.7.1.1. Common editing keystrokes
        2. 4.7.2. The fc and hist Commands
          1. 4.7.2.1. Examples
        3. 4.7.3. Programmable Completion (Bash Only)
          1. 4.7.3.1. Examples
      8. 4.8. Job Control
      9. 4.9. Command Execution
      10. 4.10. Restricted Shells
      11. 4.11. Built-in Commands (Bash and Korn Shells)
    5. 5. tcsh: An Extended C Shell
      1. 5.1. Overview of Features
      2. 5.2. Invoking the Shell
        1. 5.2.1. Options
        2. 5.2.2. Arguments
      3. 5.3. Syntax
        1. 5.3.1. Special Files
        2. 5.3.2. Filename Metacharacters
          1. 5.3.2.1. Examples
        3. 5.3.3. Quoting
          1. 5.3.3.1. Examples
        4. 5.3.4. Command Forms
          1. 5.3.4.1. Examples
        5. 5.3.5. Redirection Forms
          1. 5.3.5.1. Simple redirection
          2. 5.3.5.2. Multiple redirection
          3. 5.3.5.3. Examples
      4. 5.4. Variables
        1. 5.4.1. Variable Substitution
          1. 5.4.1.1. Examples
        2. 5.4.2. Variable Modifiers
          1. 5.4.2.1. Examples using pathname modifiers
          2. 5.4.2.2. Examples using quoting modifiers
        3. 5.4.3. Predefined Shell Variables
        4. 5.4.4. Formatting for the Prompt Variable
        5. 5.4.5. Sample .tcshrc File
        6. 5.4.6. Environment Variables
      5. 5.5. Expressions
        1. 5.5.1. Operators
          1. 5.5.1.1. Assignment operators
          2. 5.5.1.2. Arithmetic operators
          3. 5.5.1.3. Bitwise and logical operators
          4. 5.5.1.4. Comparison operators
          5. 5.5.1.5. File inquiry operators
        2. 5.5.2. Examples
      6. 5.6. Command History
        1. 5.6.1. Command Substitution
        2. 5.6.2. Command Substitution Examples
        3. 5.6.3. Word Substitution
        4. 5.6.4. Word Substitution Examples
        5. 5.6.5. History Modifiers
          1. 5.6.5.1. Printing, substitution, and quoting
          2. 5.6.5.2. Truncation
        6. 5.6.6. History Modifier Examples
        7. 5.6.7. Special Aliases
          1. 5.6.7.1. Examples
      7. 5.7. Command-Line Manipulation
        1. 5.7.1. Completion
        2. 5.7.2. Related Shell Variables
        3. 5.7.3. Related Command-Line Editor Commands
        4. 5.7.4. Related Shell Built-ins
        5. 5.7.5. Command-Line Editing
          1. 5.7.5.1. Emacs mode
          2. 5.7.5.2. vi mode
      8. 5.8. Job Control
      9. 5.9. Built-in Commands
    6. 6. Package Management
      1. 6.1. Linux Package Management
      2. 6.2. The Red Hat Package Manager
        1. 6.2.1. RPM Package Concepts
        2. 6.2.2. The rpm Command
          1. 6.2.2.1. General options
          2. 6.2.2.2. Install, upgrade, and freshen options
          3. 6.2.2.3. Query options
          4. 6.2.2.4. Uninstall options
          5. 6.2.2.5. Verify options
          6. 6.2.2.6. Database rebuild options
          7. 6.2.2.7. Signature check options
          8. 6.2.2.8. Miscellaneous options
          9. 6.2.2.9. FTP/HTTP options
        3. 6.2.3. RPM Examples
        4. 6.2.4. The rpmbuild Command
          1. 6.2.4.1. rpmbuild options
      3. 6.3. Yum: Yellowdog Updater Modified
        1. 6.3.1. The yum Command
          1. 6.3.1.1. General options
        2. 6.3.2. Yum Command Summary
      4. 6.4. up2date: Red Hat Update Agent
        1. 6.4.1. Options
      5. 6.5. The Debian Package Manager
        1. 6.5.1. Files
        2. 6.5.2. Package Priorities
        3. 6.5.3. Package and Selection States
        4. 6.5.4. Package Flags
        5. 6.5.5. Scripts
        6. 6.5.6. Debian Package Manager Command Summary
      6. 6.6. Mac OS X Package Management
        1. 6.6.1. Fink and Fink Commander
        2. 6.6.2. The GNU Mac OS X Public Archive
        3. 6.6.3. Building from Source
      7. 6.7. Solaris Package Management
        1. 6.7.1. Solaris Package Management Command Summary
  4. II. Text Editing and Processing
    1. 7. Pattern Matching
      1. 7.1. Filenames Versus Patterns
      2. 7.2. Metacharacters
        1. 7.2.1. Search Patterns
        2. 7.2.2. Replacement Patterns
      3. 7.3. Metacharacters, Listed by Unix Program
      4. 7.4. Examples of Searching
        1. 7.4.1. Examples of Searching and Replacing
    2. 8. The Emacs Editor
      1. 8.1. Conceptual Overview
        1. 8.1.1. Modes
        2. 8.1.2. Buffer and Window
        3. 8.1.3. Point and Mark
        4. 8.1.4. Kill and Yank
        5. 8.1.5. Notes on the Tables
        6. 8.1.6. Absolutely Essential Commands
      2. 8.2. Command-Line Syntax
      3. 8.3. Summary of Commands by Group
        1. 8.3.1. File-Handling Commands
        2. 8.3.2. Cursor-Movement Commands
        3. 8.3.3. Deletion Commands
        4. 8.3.4. Paragraphs and Regions
        5. 8.3.5. Stopping and Undoing Commands
        6. 8.3.6. Transposition Commands
        7. 8.3.7. Search Commands
        8. 8.3.8. Capitalization Commands
        9. 8.3.9. Word-Abbreviation Commands
        10. 8.3.10. Buffer-Manipulation Commands
        11. 8.3.11. Window Commands
        12. 8.3.12. Special Shell Characters
        13. 8.3.13. Indentation Commands
        14. 8.3.14. Centering Commands
        15. 8.3.15. Macro Commands
        16. 8.3.16. Basic Indentation Commands
        17. 8.3.17. Detail Information Help Commands
        18. 8.3.18. Help Commands
      4. 8.4. Summary of Commands by Key
        1. 8.4.1. Control-Key Sequences
        2. 8.4.2. Meta-Key Sequences
      5. 8.5. Summary of Commands by Name
    3. 9. The vi, ex, and vim Editors
      1. 9.1. Conceptual Overview
      2. 9.2. Command-Line Syntax
        1. 9.2.1. Command-Line Options
      3. 9.3. Review of vi Operations
        1. 9.3.1. Command Mode
        2. 9.3.2. Insert Mode
        3. 9.3.3. Syntax of vi Commands
          1. 9.3.3.1. Examples
          2. 9.3.3.2. Visual mode (vim only)
        4. 9.3.4. Status-Line Commands
      4. 9.4. vi Commands
        1. 9.4.1. Movement Commands
          1. 9.4.1.1. Character
          2. 9.4.1.2. Text
          3. 9.4.1.3. Lines
          4. 9.4.1.4. Screens
          5. 9.4.1.5. Searches
          6. 9.4.1.6. Line numbering
          7. 9.4.1.7. Marks
        2. 9.4.2. Insert Commands
        3. 9.4.3. Edit Commands
          1. 9.4.3.1. Changing and deleting text
          2. 9.4.3.2. Copying and moving
        4. 9.4.4. Saving and Exiting
        5. 9.4.5. Accessing Multiple Files
        6. 9.4.6. Window Commands (vim)
        7. 9.4.7. Interacting with the System
        8. 9.4.8. Macros
        9. 9.4.9. Miscellaneous Commands
      5. 9.5. vi Configuration
        1. 9.5.1. The :set Command
        2. 9.5.2. Options Used by :set
        3. 9.5.3. Example .exrc File
      6. 9.6. ex Basics
        1. 9.6.1. Syntax of ex Commands
        2. 9.6.2. Addresses
        3. 9.6.3. Address Symbols
        4. 9.6.4. Options
      7. 9.7. Alphabetical Summary of ex Commands
    4. 10. The sed Editor
      1. 10.1. Conceptual Overview
        1. 10.1.1. Typical Uses of sed
        2. 10.1.2. sed Operation
      2. 10.2. Command-Line Syntax
        1. 10.2.1. Standard Options
        2. 10.2.2. GNU sed Options
      3. 10.3. Syntax of sed Commands
        1. 10.3.1. Pattern Addressing
        2. 10.3.2. Examples
        3. 10.3.3. GNU sed Regular Expression Extensions
      4. 10.4. Group Summary of sed Commands
        1. 10.4.1. Basic Editing
        2. 10.4.2. Line Information
        3. 10.4.3. Input/Output Processing
        4. 10.4.4. Yanking and Putting
        5. 10.4.5. Branching Commands
        6. 10.4.6. Multiline Input Processing
      5. 10.5. Alphabetical Summary of sed Commands
    5. 11. The awk Programming Language
      1. 11.1. Conceptual Overview
      2. 11.2. Command-Line Syntax
        1. 11.2.1. Standard Options
        2. 11.2.2. Important gawk Options
      3. 11.3. Patterns and Procedures
        1. 11.3.1. Patterns
        2. 11.3.2. Procedures
        3. 11.3.3. Simple Pattern-Action Examples
      4. 11.4. Built-in Variables
      5. 11.5. Operators
      6. 11.6. Variable and Array Assignment
        1. 11.6.1. Escape Sequences
        2. 11.6.2. Octal and Hexadecimal Constants in gawk
      7. 11.7. User-Defined Functions
      8. 11.8. Gawk-Specific Features
        1. 11.8.1. Coprocesses and Sockets
        2. 11.8.2. Profiling
        3. 11.8.3. File Inclusion
        4. 11.8.4. Internationalization
      9. 11.9. Implementation Limits
      10. 11.10. Group Listing of awk Functions and Commands
      11. 11.11. Alphabetical Summary of awk Functions and Commands
      12. 11.12. Output Redirections
        1. 11.12.1. printf Formats
      13. 11.13. Source Code
  5. III. Software Development
    1. 12. Source Code Management: An Overview
      1. 12.1. Introduction and Terminology
      2. 12.2. Usage Models
      3. 12.3. Unix Source Code Management Systems
      4. 12.4. Other Source Code Management Systems
    2. 13. The Revision Control System
      1. 13.1. Overview of Commands
      2. 13.2. Basic Operation
      3. 13.3. General RCS Specifications
        1. 13.3.1. Keyword Substitution
        2. 13.3.2. Keywords
        3. 13.3.3. Example Values
        4. 13.3.4. Revision Numbering
        5. 13.3.5. Specifying the Date
        6. 13.3.6. Specifying States
        7. 13.3.7. Standard Options and Environment Variables
      4. 13.4. Alphabetical Summary of Commands
    3. 14. The Concurrent Versions System
      1. 14.1. Conceptual Overview
        1. 14.1.1. CVS Wrappers
        2. 14.1.2. Stickiness
      2. 14.2. Command-Line Syntax and Options
        1. 14.2.1. cvs Options
        2. 14.2.2. Common Subcommand Options
      3. 14.3. Dot Files
      4. 14.4. Environment Variables
        1. 14.4.1. Client Environment Variables
        2. 14.4.2. Server Environment Variables
      5. 14.5. Keywords and Keyword Modes
      6. 14.6. Dates
        1. 14.6.1. Legal Date Formats
          1. 14.6.1.1. ISO 8601
          2. 14.6.1.2. RFC 822 and RFC 1123
        2. 14.6.2. Legal Date Keywords
        3. 14.6.3. Time Zones
      7. 14.7. CVSROOT Variables
        1. 14.7.1. Environment Variables in CVSROOT Files
        2. 14.7.2. Internal Variables in CVSROOT Files
        3. 14.7.3. Shell Variables in CVSROOT Files
      8. 14.8. Alphabetical Summary of Commands
    4. 15. The Subversion Version Control System
      1. 15.1. Conceptual Overview
        1. 15.1.1. Basic Version Control Operations
        2. 15.1.2. Building a Better CVS
        3. 15.1.3. Converting a Repository from CVS to Subversion
        4. 15.1.4. Special File Properties
      2. 15.2. Obtaining Subversion
        1. 15.2.1. Subversion Releases
        2. 15.2.2. A View Down the Road
        3. 15.2.3. Source Code
      3. 15.3. Using Subversion: A Quick Tour
      4. 15.4. The Subversion Command Line Client: svn
        1. 15.4.1. svn Options
        2. 15.4.2. svn Subcommands
      5. 15.5. Repository Administration: svnadmin
        1. 15.5.1. svnadmin Options
        2. 15.5.2. svnadmin Subcommands
      6. 15.6. Examining the Repository: svnlook
        1. 15.6.1. svnlook Options
        2. 15.6.2. svnlook Subcommands
      7. 15.7. Providing Remote Access: svnserve
        1. 15.7.1. svnserve Options
      8. 15.8. Other Subversion Components
    5. 16. The GNU make Utility
      1. 16.1. Conceptual Overview
      2. 16.2. Command-Line Syntax
        1. 16.2.1. Options
      3. 16.3. Makefile Lines
        1. 16.3.1. Special Dependencies
        2. 16.3.2. Conditional Input
      4. 16.4. Macros
        1. 16.4.1. Creating and Using Macros
          1. 16.4.1.1. Defining macros
          2. 16.4.1.2. Macro values
          3. 16.4.1.3. Exporting macros
          4. 16.4.1.4. Overriding command-line macros
        2. 16.4.2. Internal Macros
        3. 16.4.3. Macro Modifiers
        4. 16.4.4. Macros with Special Handling
        5. 16.4.5. Text Manipulation with Macros and Functions
      5. 16.5. Special Target Names
      6. 16.6. Writing Command Lines
    6. 17. The GDB Debugger
      1. 17.1. Conceptual Overview
        1. 17.1.1. Source Code Locations
      2. 17.2. Command-Line Syntax
      3. 17.3. Initialization Files
        1. 17.3.1. The .gdbinit File
        2. 17.3.2. The .inputrc File
      4. 17.4. GDB Expressions
        1. 17.4.1. The Value History
        2. 17.4.2. Convenience Variables and Machine Registers
        3. 17.4.3. Special Expressions
      5. 17.5. The GDB Text User Interface
      6. 17.6. Group Listing of GDB Commands
        1. 17.6.1. Aliases for Other Commands
        2. 17.6.2. Breakpoints
        3. 17.6.3. Examining Data
        4. 17.6.4. Controlling and Examining Files
        5. 17.6.5. Running a Program
        6. 17.6.6. Examining the Stack
        7. 17.6.7. Status Inquiries
        8. 17.6.8. Support Facilities
        9. 17.6.9. Text User Interface Commands
        10. 17.6.10. Frequently Used Commands
      7. 17.7. Summary of set and show Commands
      8. 17.8. Summary of the info Command
      9. 17.9. Alphabetical Summary of GDB Commands
    7. 18. Writing Manual Pages
      1. 18.1. Introduction
      2. 18.2. Overview of nroff/troff
        1. 18.2.1. Command-Line Invocation
          1. 18.2.1.1. Example
        2. 18.2.2. Conceptual Overview
          1. 18.2.2.1. Requests and macros
          2. 18.2.2.2. Specifying measurements
          3. 18.2.2.3. Requests that cause a line break
          4. 18.2.2.4. Embedded formatting controls
        3. 18.2.3. Outline of Useful Requests
        4. 18.2.4. Useful Escape Sequences
        5. 18.2.5. Special Characters
      3. 18.3. Alphabetical Summary of man Macros
      4. 18.4. Predefined Strings
      5. 18.5. Internal Names
      6. 18.6. Sample Document
  6. IV. References
    1. A. ISO 8859-1 (Latin-1) Character Set
    2. B. Bibliography
      1. Unix Descriptions and Programmer’s Manuals
      2. Unix Internals
      3. System and Network Administration
      4. Programming with the Unix Mindset
      5. Programming Languages
      6. TCP/IP Networking
      7. Software Development
      8. Emacs
      9. Standards
      10. O’Reilly Books
  7. Index
  8. About the Author
  9. Colophon
  10. Copyright

Product information

  • Title: Unix in a Nutshell, 4th Edition
  • Author(s): Arnold Robbins
  • Release date: October 2005
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596100292