Books & Videos

Table of Contents

  1. Basic Unix Environment

    1. Chapter 1 Introduction

      1. What's Special About Unix?
      2. Power Grows on You
      3. The Core of Unix
      4. Communication with Unix
      5. Programs Are Designed to Work Together
      6. There Are Many Shells
      7. Which Shell Am I Running?
      8. Anyone Can Program the Shell
      9. Internal and External Commands
      10. The Kernel and Daemons
      11. Filenames
      12. Filename Extensions
      13. Wildcards
      14. The Tree Structure of the Filesystem
      15. Your Home Directory
      16. Making Pathnames
      17. File Access Permissions
      18. The Superuser (Root)
      19. When Is a File Not a File?
      20. Scripting
      21. Unix Networking and Communications
      22. The X Window System
    2. Chapter 2 Getting Help

      1. The man Command
      2. whatis: One-Line Command Summaries
      3. whereis: Finding Where a Command Is Located
      4. Searching Online Manual Pages
      5. How Unix Systems Remember Their Names
      6. Which Version Am I Using?
      7. What tty Am I On?
      8. Who's On?
      9. The info Command
  2. Customizing Your Environment

    1. Chapter 3 Setting Up Your Unix Shell

      1. What Happens When You Log In
      2. The Mac OS X Terminal Application
      3. Shell Setup Files — Which, Where, and Why
      4. Login Shells, Interactive Shells
      5. What Goes in Shell Setup Files?
      6. Tip for Changing Account Setup: Keep a Shell Ready
      7. Use Absolute Pathnames in Shell Setup Files
      8. Setup Files Aren't Read When You Want?
      9. Gotchas in set prompt Test
      10. Automatic Setups for Different Terminals
      11. Terminal Setup: Testing TERM
      12. Terminal Setup: Testing Remote Hostname and X Display
      13. Terminal Setup: Testing Port
      14. Terminal Setup: Testing Environment Variables
      15. Terminal Setup: Searching Terminal Table
      16. Terminal Setup: Testing Window Size
      17. Terminal Setup: Setting and Testing Window Name
      18. A .cshrc.$HOST File for Per Host Setup
      19. Making a "Login" Shell
      20. RC Files
      21. Make Your Own Manpages Without Learning troff
      22. Writing a Simple Manpage with the -man Macros
    2. Chapter 4 Interacting with Your Environment

      1. Basics of Setting the Prompt
      2. Static Prompts
      3. Dynamic Prompts
      4. Simulating Dynamic Prompts
      5. C-Shell Prompt Causes Problems in vi, rsh, etc.
      6. Faster Prompt Setting with Built-ins
      7. Multiline Shell Prompts
      8. Session Info in Window Title or Status Line
      9. A "Menu Prompt" for Naive Users
      10. Highlighting and Color in Shell Prompts
      11. Right-Side Prompts
      12. Show Subshell Level with $SHLVL
      13. What Good Is a Blank Shell Prompt?
      14. dirs in Your Prompt: Better Than $cwd
      15. External Commands Send Signals to Set Variables
      16. Preprompt, Pre-execution, and Periodic Commands
      17. Running Commands When You Log Out
      18. Running Commands at Bourne/Korn Shell Logout
      19. Stop Accidental Bourne-Shell Logouts
    3. Chapter 5 Getting the Most out of Terminals, xterm, and X Windows

      1. There's a Lot to Know About Terminals
      2. The Idea of a Terminal Database
      3. Setting the Terminal Type When You Log In
      4. Querying Your Terminal Type: qterm
      5. Querying Your xterm Size: resize
      6. Checklist: Terminal Hangs When I Log In
      7. Find Out Terminal Settings with stty
      8. Setting Your Erase, Kill, and Interrupt Characters
      9. Working with xterm and Friends
      10. Login xterms and rxvts
      11. Working with Scrollbars
      12. How Many Lines to Save?
      13. Simple Copy and Paste in xterm
      14. Defining What Makes Up a Word for Selection Purposes
      15. Setting the Titlebar and Icon Text
      16. The Simple Way to Pick a Font
      17. The xterm Menus
      18. Changing Fonts Dynamically
      19. Working with xclipboard
      20. Problems with Large Selections
      21. Tips for Copy and Paste Between Windows
      22. Running a Single Command with xterm -e
      23. Don't Quote Arguments to xterm -e
    4. Chapter 6 Your X Environment

      1. Defining Keys and Button Presses with xmodmap
      2. Using xev to Learn Keysym Mappings
      3. X Resource Syntax
      4. X Event Translations
      5. Setting X Resources: Overview
      6. Setting Resources with the -xrm Option
      7. How -name Affects Resources
      8. Setting Resources with xrdb
      9. Listing the Current Resources for a Client: appres
      10. Starting Remote X Clients
  3. Working with Files and Directories

    1. Chapter 7 Directory Organization

      1. What? Me, Organized?
      2. Many Homes
      3. Access to Directories
      4. A bin Directory for Your Programs and Scripts
      5. Private (Personal) Directories
      6. Naming Files
      7. Make More Directories!
      8. Making Directories Made Easier
    2. Chapter 8 Directories and Files

      1. Everything but the find Command
      2. The Three Unix File Times
      3. Finding Oldest or Newest Files with ls -t and ls -u
      4. List All Subdirectories with ls -R
      5. The ls -d Option
      6. Color ls
      7. Some GNU ls Features
      8. A csh Alias to List Recently Changed Files
      9. Showing Hidden Files with ls -A and -a
      10. Useful ls Aliases
      11. Can't Access a File? Look for Spaces in the Name
      12. Showing Nonprintable Characters in Filenames
      13. Counting Files by Types
      14. Listing Files by Age and Size
      15. newer: Print the Name of the Newest File
      16. oldlinks: Find Unconnected Symbolic Links
      17. Picking a Unique Filename Automatically
    3. Chapter 9 Finding Files with find

      1. How to Use find
      2. Delving Through a Deep Directory Tree
      3. Don't Forget -print
      4. Looking for Files with Particular Names
      5. Searching for Old Files
      6. Be an Expert on find Search Operators
      7. The Times That find Finds
      8. Exact File-Time Comparisons
      9. Running Commands on What You Find
      10. Using -exec to Create Custom Tests
      11. Custom -exec Tests Applied
      12. Finding Many Things with One Command
      13. Searching for Files by Type
      14. Searching for Files by Size
      15. Searching for Files by Permission
      16. Searching by Owner and Group
      17. Duplicating a Directory Tree
      18. Using "Fast find" Databases
      19. Wildcards with "Fast find" Database
      20. Finding Files (Much) Faster with a find Database
      21. grepping a Directory Tree
      22. lookfor: Which File Has That Word?
      23. Using Shell Arrays to Browse Directories
      24. Finding the (Hard) Links to a File
      25. Finding Files with -prune
      26. Quick finds in the Current Directory
      27. Skipping Parts of a Tree in find
      28. Keeping find from Searching Networked Filesystem
    4. Chapter 10 Linking, Renaming, and Copying Files

      1. What's So Complicated About Copying Files
      2. What's Really in a Directory?
      3. Files with Two or More Names
      4. More About Links
      5. Creating and Removing Links
      6. Stale Symbolic Links
      7. Linking Directories
      8. Showing the Actual Filenames for Symbolic Links
      9. Renaming, Copying, or Comparing a Set of Files
      10. Renaming a List of Files Interactively
      11. One More Way to Do It
      12. Copying Directory Trees with cp -r
      13. Copying Directory Trees with tar and Pipes
    5. Chapter 11 Comparing Files

      1. Checking Differences with diff
      2. Comparing Three Different Versions with diff3
      3. Context diffs
      4. Side-by-Side diffs: sdiff
      5. Choosing Sides with sdiff
      6. Problems with diff and Tabstops
      7. cmp and diff
      8. Comparing Two Files with comm
      9. More Friendly comm Output
      10. make Isn't Just for Programmers!
      11. Even More Uses for make
    6. Chapter 12 Showing What's in a File

      1. Cracking the Nut
      2. What Good Is a cat?
      3. "less" is More
      4. Show Nonprinting Characters with cat -v or od -c
      5. What's in That Whitespace?
      6. Finding File Types
      7. Squash Extra Blank Lines
      8. How to Look at the End of a File: tail
      9. Finer Control on tail
      10. How to Look at Files as They Grow
      11. GNU tail File Following
      12. Printing the Top of a File
      13. Numbering Lines
    7. Chapter 13 Searching Through Files

      1. Different Versions of grep
      2. Searching for Text with grep
      3. Finding Text That Doesn't Match
      4. Extended Searching for Text with egrep
      5. grepping for a List of Patterns
      6. Approximate grep: agrep
      7. Search RCS Files with rcsgrep
      8. GNU Context greps
      9. A Multiline Context grep Using sed
      10. Compound Searches
      11. Narrowing a Search Quickly
      12. Faking Case-Insensitive Searches
      13. Finding a Character in a Column
      14. Fast Searches and Spelling Checks with "look"
      15. Finding Words Inside Binary Files
      16. A Highlighting grep
    8. Chapter 14 Removing Files

      1. The Cycle of Creation and Destruction
      2. How Unix Keeps Track of Files: Inodes
      3. rm and Its Dangers
      4. Tricks for Making rm Safer
      5. Answer "Yes" or "No" Forever with yes
      6. Remove Some, Leave Some
      7. A Faster Way to Remove Files Interactively
      8. Safer File Deletion in Some Directories
      9. Safe Delete: Pros and Cons
      10. Deletion with Prejudice: rm -f
      11. Deleting Files with Odd Names
      12. Using Wildcards to Delete Files with Strange Names
      13. Handling a Filename Starting with a Dash (-)
      14. Using unlink to Remove a File with a Strange Name
      15. Removing a Strange File by its i-number
      16. Problems Deleting Directories
      17. Deleting Stale Files
      18. Removing Every File but One
      19. Using find to Clear Out Unneeded Files
    9. Chapter 15 Optimizing Disk Space

      1. Disk Space Is Cheap
      2. Instead of Removing a File, Empty It
      3. Save Space with "Bit Bucket" Log Files and Mailboxes
      4. Save Space with a Link
      5. Limiting File Sizes
      6. Compressing Files to Save Space
      7. Save Space: tar and compress a Directory Tree
      8. How Much Disk Space?
      9. Compressing a Directory Tree: Fine-Tuning
      10. Save Space in Executable Files with strip
      11. Disk Quotas
  4. Basic Editing

    1. Chapter 16 Spell Checking, Word Counting, and Textual Analysis

      1. The Unix spell Command
      2. Check Spelling Interactively with ispell
      3. How Do I Spell That Word?
      4. Inside spell
      5. Adding Words to ispell's Dictionary
      6. Counting Lines, Words, and Characters: wc
      7. Find a a Doubled Word
      8. Looking for Closure
      9. Just the Words, Please
    2. Chapter 17 vi Tips and Tricks

      1. The vi Editor: Why So Much Material?
      2. What We Cover
      3. Editing Multiple Files with vi
      4. Edits Between Files
      5. Local Settings for vi
      6. Using Buffers to Move or Copy Text
      7. Get Back What You Deleted with Numbered Buffers
      8. Using Search Patterns and Global Commands
      9. Confirming Substitutions in vi
      10. Keep Your Original File, Write to a New File
      11. Saving Part of a File
      12. Appending to an Existing File
      13. Moving Blocks of Text by Patterns
      14. Useful Global Commands (with Pattern Matches)
      15. Counting Occurrences; Stopping Search Wraps
      16. Capitalizing Every Word on a Line
      17. Per-File Setups in Separate Files
      18. Filtering Text Through a Unix Command
      19. vi File Recovery Versus Networked Filesystems
      20. Be Careful with vi -r Recovered Buffers
      21. Shell Escapes: Running One UnixCommand While Using Another
      22. vi Compound Searches
      23. vi Word Abbreviation
      24. Using vi Abbreviations as Commands (Cut and Paste Between vi's)
      25. Fixing Typos with vi Abbreviations
      26. vi Line Commands Versus Character Commands
      27. Out of Temporary Space? Use Another Directory
      28. Neatening Lines
      29. Finding Your Place with Undo
      30. Setting Up vi with the .exrc File
    3. Chapter 18 Creating Custom Commands in vi

      1. Why Type More Than You Have To?
      2. Save Time and Typing with the vi map Commands
      3. What You Lose When You Use map!
      4. vi @-Functions
      5. Keymaps for Pasting into a Window Running vi
      6. Protecting Keys from Interpretation by ex
      7. Maps for Repeated Edits
      8. More Examples of Mapping Keys in vi
      9. Repeating a vi Keymap
      10. Typing in Uppercase Without CAPS LOCK
      11. Text-Input Mode Cursor Motion with No Arrow Keys
      12. Don't Lose Important Functions with vi Maps: Use noremap
      13. vi Macro for Splitting Long Lines
      14. File-Backup Macros
    4. Chapter 19 GNU Emacs

      1. Emacs: The Other Editor
      2. Emacs Features: A Laundry List
      3. Customizations and How to Avoid Them
      4. Backup and Auto-Save Files
      5. Putting Emacs in Overwrite Mode
      6. Command Completion
      7. Mike's Favorite Timesavers
      8. Rational Searches
      9. Unset PWD Before Using Emacs
      10. Inserting Binary Characters into Files
      11. Using Word-Abbreviation Mode
      12. Directories for Emacs Hacks
      13. An Absurd Amusement
    5. Chapter 20 Batch Editing

      1. Why Line Editors Aren't Dinosaurs
      2. Writing Editing Scripts
      3. Line Addressing
      4. Useful ex Commands
      5. Running Editing Scripts Within vi
      6. Change Many Files by Editing Just One
      7. ed/ex Batch Edits: A Typical Example
      8. Batch Editing Gotcha: Editors Fail on Big Files
      9. patch: Generalized Updating of Files That Differ
      10. Quick Reference: awk
      11. Versions of awk
    6. Chapter 21 You Can't Quite Call This Editing

      1. And Why Not?
      2. Neatening Text with fmt
      3. Alternatives to fmt
      4. Clean Up Program Comment Blocks
      5. Remove Mail/News Headers with behead
      6. Low-Level File Butchery with dd
      7. offset: Indent Text
      8. Centering Lines in a File
      9. Splitting Files at Fixed Points: split
      10. Splitting Files by Context: csplit
      11. Hacking on Characters with tr
      12. Encoding "Binary" Files into ASCII
      13. Text Conversion with dd
      14. Cutting Columns or Fields
      15. Making Text in Columns with pr
      16. Make Columns Automatically with column
      17. Straightening Jagged Columns
      18. Pasting Things in Columns
      19. Joining Lines with join
      20. What Is (or Isn't) Unique?
      21. Rotating Text
    7. Chapter 22 Sorting

      1. Putting Things in Order
      2. Sort Fields: How sort Sorts
      3. Changing the sort Field Delimiter
      4. Confusion with Whitespace Field Delimiters
      5. Alphabetic and Numeric Sorting
      6. Miscellaneous sort Hints
      7. lensort: Sort Lines by Length
      8. Sorting a List of People by Last Name
  5. Processes and the Kernel

    1. Chapter 23 Job Control

      1. Job Control in a Nutshell
      2. Job Control Basics
      3. Using jobs Effectively
      4. Some Gotchas with Job Control
      5. The "Current Job" Isn't Always What You Expect
      6. Job Control and autowrite: Real Timesavers!
      7. System Overloaded? Try Stopping Some Jobs
      8. Notification When Jobs Change State
      9. Stop Background Output with stty tostop
      10. nohup
      11. Disowning Processes
      12. Linux Virtual Consoles
      13. Stopping Remote Login Sessions
    2. Chapter 24 Starting, Stopping, and Killing Processes

      1. What's in This Chapter
      2. fork and exec
      3. Managing Processes: Overall Concepts
      4. Subshells
      5. The ps Command
      6. The Controlling Terminal
      7. Tracking Down Processes
      8. Why ps Prints Some Commands in Parentheses
      9. The /proc Filesystem
      10. What Are Signals?
      11. Killing Foreground Jobs
      12. Destroying Processes with kill
      13. Printer Queue Watcher: A Restartable Daemon Shell Script
      14. Killing All Your Processes
      15. Killing Processes by Name?
      16. Kill Processes Interactively
      17. Processes Out of Control? Just STOP Them
      18. Cleaning Up an Unkillable Process
      19. Why You Can't Kill a Zombie
      20. The Process Chain to Your Window
      21. Terminal Windows Without Shells
      22. Close a Window by Killing Its Process(es)
    3. Chapter 25 Delayed Execution

      1. Building Software Robots the Easy Way
      2. Periodic Program Execution: The cron Facility
      3. Adding crontab Entries
      4. Including Standard Input Within a cron Entry
      5. The at Command
      6. Making Your at Jobs Quiet
      7. Checking and Removing Jobs
      8. Avoiding Other at and cron Jobs
      9. Waiting a Little While: sleep
    4. Chapter 26 System Performance and Profiling

      1. Timing Is Everything
      2. Timing Programs
      3. What Commands Are Running and How Long Do They Take?
      4. Checking System Load: uptime
      5. Know When to Be "nice" to Other Users...and When Not To
      6. A nice Gotcha
      7. Changing a Running Job's Niceness
  6. Scripting

    1. Chapter 27 Shell Interpretation

      1. What the Shell Does
      2. How the Shell Executes Other Commands
      3. What's a Shell, Anyway?
      4. Command Evaluation and Accidentally Overwriting Files
      5. Output Command-Line Arguments One by One
      6. Controlling Shell Command Searches
      7. Wildcards Inside Aliases
      8. eval: When You Need Another Chance
      9. Which One Will bash Use?
      10. Which One Will the C Shell Use?
      11. Is It "2>&1 file" or "> file 2>&1"? Why?
      12. Bourne Shell Quoting
      13. Differences Between Bourne and C Shell Quoting
      14. Quoting Special Characters in Filenames
      15. Verbose and Echo Settings Show Quoting
      16. Here Documents
      17. "Special" Characters and Operators
      18. How Many Backslashes?
    2. Chapter 28 Saving Time on the Command Line

      1. What's Special About the Unix Command Line
      2. Reprinting Your Command Line with CTRL-r
      3. Use Wildcards to Create Files?
      4. Build Strings with { }
      5. String Editing (Colon) Operators
      6. Automatic Completion
      7. Don't Match Useless Files in Filename Completion
      8. Repeating Commands
      9. Repeating and Varying Commands
      10. Repeating a Command with Copy-and-Paste
      11. Repeating a Time-Varying Command
      12. Multiline Commands, Secondary Prompts
      13. Here Document Example #1: Unformatted Form Letters
      14. Command Substitution
      15. Handling Lots of Text with Temporary Files
      16. Separating Commands with Semicolons
      17. Dealing with Too Many Arguments
      18. Expect
    3. Chapter 29 Custom Commands

      1. Creating Custom Commands
      2. Introduction to Shell Aliases
      3. C-Shell Aliases with Command-Line Arguments
      4. Setting and Unsetting Bourne-Type Aliases
      5. Korn-Shell Aliases
      6. zsh Aliases
      7. Sourceable Scripts
      8. Avoiding C-Shell Alias Loops
      9. How to Put if-then-else in a C-Shell Alias
      10. Fix Quoting in csh Aliases with makealias and quote
      11. Shell Function Basics
      12. Shell Function Specifics
      13. Propagating Shell Functions
      14. Simulated Bourne Shell Functions and Aliases
    4. Chapter 30 The Use of History

      1. The Lessons of History
      2. History in a Nutshell
      3. My Favorite Is !$
      4. My Favorite Is !:n*
      5. My Favorite Is ^^
      6. Using !$ for Safety with Wildcards
      7. History by Number
      8. History Substitutions
      9. Repeating a Cycle of Commands
      10. Running a Series of Commands on a File
      11. Check Your History First with :p
      12. Picking Up Where You Left Off
      13. Pass History to Another Shell
      14. Shell Command-Line Editing
      15. Changing History Characters with histchars
      16. Instead of Changing History Characters
    5. Chapter 31 Moving Around in a Hurry

      1. Getting Around the Filesystem
      2. Using Relative and Absolute Pathnames
      3. What Good Is a Current Directory?
      4. How Does Unix Find Your Current Directory?
      5. Saving Time When You Change Directories: cdpath
      6. Loop Control: break and continue
      7. The Shells' pushd and popd Commands
      8. Nice Aliases for pushd
      9. Quick cds with Aliases
      10. cd by Directory Initials
      11. Finding (Anyone's) Home Directory, Quickly
      12. Marking Your Place with a Shell Variable
      13. Automatic Setup When You Enter/Exit a Directory
    6. Chapter 32 Regular Expressions (Pattern Matching)

      1. That's an Expression
      2. Don't Confuse Regular Expressions with Wildcards
      3. Understanding Expressions
      4. Using Metacharacters in Regular Expressions
      5. Regular Expressions: The Anchor Characters ^ and $
      6. Regular Expressions: Matching a Character with a Character Set
      7. Regular Expressions: Match Any Character with . (Dot)
      8. Regular Expressions: Specifying a Range of Characters with [...]
      9. Regular Expressions: Exceptions in a Character Set
      10. Regular Expressions: Repeating Character Sets with *
      11. Regular Expressions: Matching a Specific Number of Sets with \ { and \ }
      12. Regular Expressions: Matching Words with \ < and \ >
      13. Regular Expressions: Remembering Patterns with \ (, \ ), and \1
      14. Regular Expressions: Potential Problems
      15. Extended Regular Expressions
      16. Getting Regular Expressions Right
      17. Just What Does a Regular Expression Match?
      18. Limiting the Extent of a Match
      19. I Never Meta Character I Didn't Like
      20. Valid Metacharacters for Different Unix Programs
      21. Pattern Matching Quick Reference with Examples
    7. Chapter 33 Wildcards

      1. File-Naming Wildcards
      2. Filename Wildcards in a Nutshell
      3. Who Handles Wildcards?
      4. What if a Wildcard Doesn't Match?
      5. Maybe You Shouldn't Use Wildcards in Pathnames
      6. Getting a List of Matching Files with grep -l
      7. Getting a List of Nonmatching Files
      8. nom: List Files That Don't Match a Wildcard
    8. Chapter 34 The sed Stream Editor

      1. sed Sermon^H^H^H^H^H^HSummary
      2. Two Things You Must Know About sed
      3. Invoking sed
      4. Testing and Using a sed Script: checksed, runsed
      5. sed Addressing Basics
      6. Order of Commands in a Script
      7. One Thing at a Time
      8. Delimiting a Regular Expression
      9. Newlines in a sed Replacement
      10. Referencing the Search String in a Replacement
      11. Referencing Portions of a Search String
      12. Search and Replacement: One Match Among Many
      13. Transformations on Text
      14. Hold Space: The Set-Aside Buffer
      15. Transforming Part of a Line
      16. Making Edits Across Line Boundaries
      17. The Deliberate Scrivener
      18. Searching for Patterns Split Across Lines
      19. Multiline Delete
      20. Making Edits Everywhere Except...
      21. The sed Test Command
      22. Uses of the sed Quit Command
      23. Dangers of the sed Quit Command
      24. sed Newlines, Quoting, and Backslashes in a Shell Script
    9. Chapter 35 Shell Programming for the Uninitiated

      1. Writing a Simple Shell Program
      2. Everyone Should Learn Some Shell Programming
      3. What Environment Variables Are Good For
      4. Parent-Child Relationships
      5. Predefined Environment Variables
      6. The PATH Environment Variable
      7. PATH and path
      8. The DISPLAY Environment Variable
      9. Shell Variables
      10. Test String Values with Bourne-Shell case
      11. Pattern Matching in case Statements
      12. Exit Status of Unix Processes
      13. Test Exit Status with the if Statement
      14. Testing Your Success
      15. Loops That Test Exit Status
      16. Set Exit Status of a Shell (Script)
      17. Trapping Exits Caused by Interrupts
      18. read: Reading from the Keyboard
      19. Shell Script "Wrappers" for awk, sed, etc.
      20. Handling Command-Line Arguments in Shell Scripts
      21. Handling Command-Line Arguments with a for Loop
      22. Handling Arguments with while and shift
      23. Loop Control: break and continue
      24. Standard Command-Line Parsing
      25. The Bourne Shell set Command
      26. test: Testing Files and Strings
      27. Picking a Name for a New Command
      28. Finding a Program Name and Giving Your Program Multiple Names
      29. Reading Files with the . and source Commands
      30. Using Shell Functions in Shell Scripts
    10. Chapter 36 Shell Programming for the Initiated

      1. Beyond the Basics
      2. The Story of : # #!
      3. Don't Need a Shell for Your Script? Don't Use One
      4. Making #! Search the PATH
      5. The exec Command
      6. The Unappreciated Bourne Shell ":" Operator
      7. Parameter Substitution
      8. Save Disk Space and Programming: Multiple Names for a Program
      9. Finding the Last Command-Line Argument
      10. How to Unset All Command-Line Parameters
      11. Standard Input to a for Loop
      12. Making a for Loop with Multiple Variables
      13. Using basename and dirname
      14. A while Loop with Several Loop Control Commands
      15. Overview: Open Files and File Descriptors
      16. n>&m: Swap Standard Output and Standard Error
      17. A Shell Can Read a Script from Its Standard Input, but...
      18. Shell Scripts On-the-Fly from Standard Input
      19. Quoted hereis Document Terminators: sh Versus csh
      20. Turn Off echo for "Secret" Answers
      21. Quick Reference: expr
      22. Testing Characters in a String with expr
      23. Grabbing Parts of a String
      24. Nested Command Substitution
      25. Testing Two Strings with One case Statement
      26. Outputting Text to an X Window
      27. Shell Lockfile
    11. Chapter 37 Shell Script Debugging and Gotchas

      1. Tips for Debugging Shell Scripts
      2. Bourne Shell Debugger Shows a Shell Variable
      3. Stop Syntax Errors in Numeric Tests
      4. Stop Syntax Errors in String Tests
      5. Quoting and Command-Line Parameters
      6. How Unix Keeps Time
      7. Copy What You Do with script
      8. Cleaning script Files
      9. Making an Arbitrary-Size File for Testing
  7. Extending and Managing Your Environment

    1. Chapter 38 Backing Up Files

      1. What Is This "Backup" Thing?
      2. tar in a Nutshell
      3. Make Your Own Backups
      4. More Ways to Back Up
      5. How to Make Backups to a Local Device
      6. Restoring Files from Tape with tar
      7. Using tar to a Remote Tape Drive
      8. Using GNU tar with a Remote Tape Drive
      9. On-Demand Incremental Backups of a Project
      10. Using Wildcards with tar
      11. Avoid Absolute Paths with tar
      12. Getting tar's Arguments in the Right Order
      13. The cpio Tape Archiver
      14. Industrial Strength Backups
    2. Chapter 39 Creating and Reading Archives

      1. Packing Up and Moving
      2. Using tar to Create and Unpack Archives
      3. GNU tar Sampler
      4. Managing and Sharing Files with RCS and CVS
      5. RCS Basics
      6. List RCS Revision Numbers with rcsrevs
      7. CVS Basics
      8. More CVS
    3. Chapter 40 Software Installation

      1. /usr/bin and Other Software Directories
      2. The Challenges of Software Installation on Unix
      3. Which make?
      4. Simplifying the make Process
      5. Using Debian's dselect
      6. Installing Software with Debian's Apt-Get
      7. Interruptable gets with wget
      8. The curl Application and One-Step GNU-Darwin Auto-Installer for OS X
      9. Installation with FreeBSD Ports
      10. Installing with FreeBSD Packages
      11. Finding and Installing RPM Packaged Software
    4. Chapter 41 Perl

      1. High-Octane Shell Scripting
      2. Checking your Perl Installation
      3. Compiling Perl from Scratch
      4. Perl Boot Camp, Part 1: Typical Script Anatomy
      5. Perl Boot Camp, Part 2: Variables and Data Types
      6. Perl Boot Camp, Part 3: Branching and Looping
      7. Perl Boot Camp, Part 4: Pattern Matching
      8. Perl Boot Camp, Part 5: Perl Knows Unix
      9. Perl Boot Camp, Part 6: Modules
      10. Perl Boot Camp, Part 7: perldoc
      11. CPAN
      12. Make Custom grep Commands (etc.) with Perl
      13. Perl and the Internet
    5. Chapter 42 Python

      1. What Is Python?
      2. Installation and Distutils
      3. Python Basics
      4. Python and the Web
      5. urllib
      6. urllib2
      7. htmllib and HTMLParser
      8. cgi
      9. mod_python
      10. What About Perl?
  8. Communication and Connectivity

    1. Chapter 43 Redirecting Input and Output

      1. Using Standard Input and Output
      2. One Argument with a cat Isn't Enough
      3. Send (Only) Standard Error Down a Pipe
      4. Problems Piping to a Pager
      5. Redirection in C Shell: Capture Errors, Too?
      6. Safe I/O Redirection with noclobber
      7. The ( ) Subshell Operators
      8. Send Output Two or More Places
      9. How to tee Several Commands into One Place
      10. Redirecting Output to More Than One Place
      11. Named Pipes: FIFOs
      12. What Can You Do with an Empty File?
    2. Chapter 44 Devices

      1. Quick Introduction to Hardware
      2. Reading Kernel Boot Output
      3. Basic Kernel Configuration
      4. Disk Partitioning
      5. Filesystem Types and /etc/fstab
      6. Mounting and Unmounting Removable Filesystems
      7. Loopback Mounts
      8. Network Devices — ifconfig
      9. Mounting Network Filesystems — NFS, SMBFS
      10. Win Is a Modem Not a Modem?
      11. Setting Up a Dialup PPP Session
      12. USB Configuration
      13. Dealing with Sound Cards and Other Annoying Hardware
      14. Decapitating Your Machine — Serial Consoles
    3. Chapter 45 Printing

      1. Introduction to Printing
      2. Introduction to Printing on Unix
      3. Printer Control with lpc
      4. Using Different Printers
      5. Using Symbolic Links for Spooling
      6. Formatting Plain Text: pr
      7. Formatting Plain Text: enscript
      8. Printing Over a Network
      9. Printing Over Samba
      10. Introduction to Typesetting
      11. A Bit of Unix Typesetting History
      12. Typesetting Manpages: nroff
      13. Formatting Markup Languages — troff, LATEX, HTML, and So On
      14. Printing Languages — PostScript, PCL, DVI, PDF
      15. Converting Text Files into a Printing Language
      16. Converting Typeset Files into a Printing Language
      17. Converting Source Files Automagically Within the Spooler
      18. The Common Unix Printing System (CUPS)
      19. The Portable Bitmap Package
    4. Chapter 46 Connectivity

      1. TCP/IP — IP Addresses and Ports
      2. /etc/services Is Your Friend
      3. Status and Troubleshooting
      4. Where, Oh Where Did That Packet Go?
      5. The Director of Operations: inetd
      6. Secure Shell (SSH)
      7. Configuring an Anonymous FTP Server
      8. Mail — SMTP, POP, and IMAP
      9. Domain Name Service (DNS)
      10. Dynamic Host Configuration Protocol (DHCP)
      11. Gateways and NAT
      12. Firewalls
      13. Gatewaying from a Personal LAN over a Modem
    5. Chapter 47 Connecting to MS Windows

      1. Building Bridges
      2. Installing and Configuring Samba
      3. Securing Samba
      4. SWAT and GUI SMB Browsers
      5. Printing with Samba
      6. Connecting to SMB Shares from Unix
      7. Sharing Desktops with VNC
      8. Of Emulators and APIs
      9. Citrix: Making Windows Multiuser
  9. Security

    1. Chapter 48 Security Basics

      1. Understanding Points of Vulnerability
      2. CERT Security Checklists
      3. Keeping Up with Security Alerts
      4. What We Mean by Buffer Overflow
      5. What We Mean by DoS
      6. Beware of Sluggish Performance
      7. Intruder Detection
      8. Importance of MOTD
      9. The Linux proc Filesystem
      10. Disabling inetd
      11. Disallow rlogin and rsh
      12. TCP Wrappers
    2. Chapter 49 Root, Group, and User Management

      1. Unix User/Group Infrastructure
      2. When Does a User Become a User
      3. Forgetting the root Password
      4. Setting an Exact umask
      5. Group Permissions in a Directory with the setgid Bit
      6. Groups and Group Ownership
      7. Add Users to a Group to Deny Permissions
      8. Care and Feeding of SUID and SGID Scripts
      9. Substitute Identity with su
      10. Never Log In as root
      11. Providing Superpowers with sudo
      12. Enabling Root in Darwin
      13. Disable logins
    3. Chapter 50 File Security, Ownership, and Sharing

      1. Introduction to File Ownership and Security
      2. Tutorial on File and Directory Permissions
      3. Who Will Own a New File?
      4. Protecting Files with the Sticky Bit
      5. Using chmod to Change File Permission
      6. The Handy chmod = Operator
      7. Protect Important Files: Make Them Unwritable
      8. cx, cw, c-w: Quick File Permission Changes
      9. A Loophole: Modifying Files Without Write Access
      10. A Directory That People Can Access but Can't List
      11. Juggling Permissions
      12. File Verification with md5sum
      13. Shell Scripts Must Be Readable and (Usually) Executable
      14. Why Can't You Change File Ownership?
      15. How to Change File Ownership Without chown
    4. Chapter 51 SSH

      1. Enabling Remote Access on Mac OS X
      2. Protecting Access Through SSH
      3. Free SSH with OpenSSH
      4. SSH Problems and Solutions
      5. General and Authentication Problems
      6. Key and Agent Problems
      7. Server and Client Problems
  1. Glossary

  2. Colophon