You are previewing Learning Unix for OS X, 2nd Edition.
O'Reilly logo
Learning Unix for OS X, 2nd Edition

Book Description

Think your Mac is powerful now? Author Dave Taylor shows you how to get much more from your system by tapping into Unix, the robust operating system concealed beneath OS X’s beautiful user interface. Apple's latest OS, El Capitan, puts more than a thousand Unix commands at your fingertips—for finding and managing files, remotely accessing your Mac from other computers, and using a variety of freely downloadable open source applications. Take a friendly tour of the Unix command line and 50 of the most useful utilities, and quickly learn how to gain real control over your Mac.

Table of Contents

  1. Preface
    1. Who This Book Is For
    2. Who This Book Isn’t For
    3. A Brief History of Unix
      1. Versions of Unix
      2. Interfaces to Unix
    4. How This Book Is Organized
    5. Conventions Used in This Book
    6. Using Code Examples
    7. Safari® Books Online
    8. How to Contact Us
    9. The Evolution of This Book
    10. Acknowledgments
  2. 1. Why Use Unix?
    1. The Power of Unix
      1. Batch Renames and Extracting File Lists
      2. Finding Hidden Files
    2. Folders or Directories?
    3. Thousands of Free Applications
      1. Power Internet Connections
    4. Commands Included with Unix
      1. Displaying All Unix Commands
      2. The 10 Most Common Unix Commands
    5. A Simple Guided (Unix) Tour
  3. 2. Using the Terminal
    1. Launching the Terminal
      1. Syntax of a Unix Command
      2. Exercise: Entering a Few Commands
      3. Types of Commands
      4. Changing the Terminal’s Preferences
      5. Features of the Terminal
    2. Customizing Your Terminal Session
      1. Setting the Terminal’s Title
      2. Using AppleScript to Manipulate the Terminal
      3. Working with .terminal Files
    3. Working with the Terminal
      1. The Shell Prompt
      2. Entering a Command
      3. Recalling Previous Commands
      4. Completing File and Directory Names
      5. Running Multiple Commands on the Command Line
      6. Correcting a Command
      7. Ending Your Session
      8. Problem Checklist
    4. Customizing the Shell Environment
      1. Picking a Login Shell
      2. Changing the Command Prompt
    5. Advanced Shell Customization
      1. Shell Configuration Settings
      2. Creating Aliases
    6. The Unresponsive Terminal
  4. 3. Exploring the Filesystem
    1. The OS X Filesystem
      1. Your Home Directory
      2. Your Working Directory
      3. The Directory Tree
      4. Absolute Pathnames
      5. Relative Pathnames
      6. Changing Your Working Directory
      7. Files in the Directory Tree
    2. Listing Files and Directories
      1. The All-Powerful ls Command
      2. Trying Out the ls Command
      3. Using the -l Option
      4. File Permissions
    3. Calculating File Size and Disk Space
      1. Calculating Available Disk Space
      2. Exercise: Exploring the Filesystem
    4. Protecting and Sharing Files
      1. File Access Permissions
      2. Setting Permissions with chmod
      3. Changing the Group and Owner
    5. Changing Your Password
    6. Superuser Privileges with sudo
    7. Exploring External Volumes
  5. 4. File Management
    1. File and Directory Names
    2. File and Directory Wildcards
    3. Looking Inside Files
      1. cat
      2. less
      3. grep
    4. Creating and Editing Files
      1. Text Editors and Word Processors
      2. The vi Text Editor
      3. vi Basics
      4. A Simpler vi Alternative: Pico
      5. The More Complex Option: Emacs
    5. Managing Files
      1. Creating Directories with mkdir
      2. Copying Files
      3. Renaming and Moving Files with mv
      4. Removing Files and Directories
      5. Working with Links
      6. Compressing and Archiving Files
      7. Files on Other Operating Systems
  6. 5. Finding Files and Information
    1. Searching Inside Files with the grep Command
      1. Useful grep Options
      2. Working with Regular Expressions
    2. Finding Files with locate
      1. Fast Filename Search with locate
    3. Using find to Explore Your Filesystem
      1. Matching by File Size
      2. Exploring find Permission Strings
      3. Using find to Identify Recently Changed Files
      4. find’s Faithful Sidekick: xargs
      5. Further Refinements to find
    4. Shining a Light on Spotlight
      1. Listing Spotlight Metadata with mdls
      2. Finding Files with mdfind
      3. Making Spotlight Useful
  7. 6. Redirecting I/O
    1. Standard Input and Standard Output
      1. Putting Text in a File
    2. Pipes and Filters
      1. wc
      2. tr
      3. grep
      4. head and tail
      5. sort
      6. uniq
      7. Piping Output to a Pager
    3. Printing
      1. The Unix Way
  8. 7. Multitasking
    1. Running a Command in the Background
    2. Checking on a Process
      1. ps
      2. top
    3. Canceling a Process
      1. kill
      2. killall
    4. Launching GUI Applications
      1. open
      2. Useful Starting Options for Use with open
      3. Making open More Useful
  9. 8. Taking Unix Online
    1. Remote Logins
      1. Web Access
      2. Remote Access to Other Unix Systems
    2. Transferring Files
      1. scp and rcp
      2. FTP
      3. Easy Shortcuts with New Remote Connection
  10. 9. Of Windows and X11
    1. X11
      1. Using X11
      2. Differences Between OS X and X11
      3. Customizing X11
    2. GIMP, the X11 Graphics Editor
  11. 10. Where to Go from Here
    1. Documentation
      1. The man Command
      2. Documentation on the Internet
      3. Books
    2. Customizing Your Unix Experience
      1. Shell Aliases and Functions
      2. Programming
      3. Perl, Python, and Ruby
      4. C and C++
  12. Index