O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Macintosh Terminal Pocket Guide

Book Description

Unlock the secrets of the Terminal and discover how this powerful tool solves problems the Finder can’t handle. With this handy guide, you’ll learn commands for a variety of tasks, such as killing programs that refuse to quit, renaming a large batch of files in seconds, or running jobs in the background while you do other work.

Get started with an easy-to-understand overview of the Terminal and its partner, the shell. Then dive into commands neatly arranged into two dozen categories, including directory operations, file comparisons, and network connections. Each command includes a concise description of its purpose and features.

  • Log into your Mac from remote locations
  • Search and modify files in powerful ways
  • Schedule jobs for particular days and times
  • Let several people use one Mac at the same time
  • Compress and uncompress files in a variety of formats
  • View and manipulate Mac OS X processes
  • Combine multiple commands to perform complex operations
  • Download and install additional commands from the Internet

Table of Contents

  1. 1. The Macintosh Terminal
    1. What’s in This Book?
      1. What’s the Terminal?
      2. What’s a Command?
      3. Ten Commands to Try
      4. Reading This Book
        1. Standard Input and Output
        2. Keystrokes
        3. Long lines
        4. Your friend, the echo command
        5. Quick help
    2. Running the Terminal
    3. The Filesystem
      1. Structure of the Filesystem
      2. Navigating the Filesystem
      3. Home Directories in the Filesystem
      4. System Directories in the Filesystem
        1. Directory path part 1: category
        2. Directory path part 2: scope
        3. Directory path part 3: application
      5. File Protections
    4. The Shell
      1. The Shell Versus Programs
      2. Selected Features of the bash Shell
        1. Wildcards
        2. Brace expansion
        3. Shell variables
        4. Search path
        5. Aliases
        6. Input/output redirection
        7. Pipes
        8. Combining commands
        9. Quoting
        10. Escaping
        11. Command-line editing
        12. Command history
        13. Filename completion
      3. Shell Job Control
      4. Killing a Command in Progress
      5. Terminating a Shell
      6. Tailoring Shell Behavior
  2. 2. Commands
    1. Basic File Operations
    2. Directory Operations
    3. File Viewing
    4. File Creation and Editing
      1. Creating a File Quickly
      2. Your Default Editor
    5. File Properties
    6. File Text Manipulation
    7. File Location
    8. File Compression and Packaging
    9. File Comparison
    10. Printing
    11. Disks and Filesystems
    12. Viewing Processes
    13. Controlling Processes
    14. Scheduling Jobs
    15. Users and Their Environment
    16. Becoming the Superuser
    17. Group Management
    18. Host Information
    19. Host Location
    20. Network Connections
    21. Email Commands
    22. Web Commands
    23. Messaging
    24. Screen Output
    25. Math and Calculations
    26. Dates and Times
  3. 3. Advanced Topics
    1. Running a Shell Remotely
      1. Enabling remote logins
      2. Logging in remotely with SSH
      3. SSH roadblocks
    2. Installing Software with a Package Manager
      1. Obtaining an Apple Developer ID
      2. Installing Xcode
      3. Installing Command Line Tools for Xcode
      4. Installing the Homebrew Package Manager
      5. Using Homebrew
      6. Installing from TAR Files
    3. Programming with Shell Scripts
      1. Creating and Running Shell Scripts
      2. Whitespace and Linebreaks
      3. Variables
      4. Input and Output
      5. Booleans and Return Codes
        1. test and “[”
        2. true and false
      6. Conditionals
      7. Loops
      8. Break and Continue
      9. Command-Line Arguments
      10. Exiting with a Return Code
      11. Beyond Shell Scripting
    4. Getting Help
    5. Final Words
      1. Acknowledgments
  4. Index
  5. About the Author
  6. Copyright