Learning Unix for Mac OS X, Second Edition

Book description

Elegant, sleek, powerful, and stable, Mac OS X has delighted many a loyal Mac user, and gone one step further--it's turned them into Unix users, too. Perhaps you're already familiar with Unix, just not on the Mac. Or perhaps you opened your Utilities folder, spotted the Terminal icon and double-clicked on it just to see what it does. Suddenly faced with a command line interface, you probably asked what does it mean, and the more pressing question, why on earth would you ever want to venture into this seemingly user-unfriendly territory? The new edition of Learning Unix for Mac OS X answers these questions and more. This compact book provides a user-friendly tour of your Mac's Unix base. As you explore Terminal and familiarize yourself with the command line, you'll also learn about the hundreds of Unix programs that come with your Mac and begin to understand the power and flexibility of Unix. And if Unix isn't new to you, you'll discover how it translates into this new Mac incarnation. Updated to cover Jaguar (Mac OS X, 10.2), this book will keep you current with the latest features of your Mac. The book begins with a quick but in-depth introduction to Terminal and the command line interface. After learning about launching and configuring the Terminal application, you'll find out how to manage, create, edit, and transfer files. You'll find all the common commands simply explained with accompanying examples, exercises, and opportunities for experimentation. There are even problem checklists to help you along the way if you get stuck. You'll learn how to:

  • Customize your shell environment

  • Manage files and directories

  • Successfully print from the Unix command line

  • Edit and create files with the vi editor

  • Perform remote logins

  • Access Internet functions

  • Understand pipes and filters

  • Use background processing

  • Use Fink, an easy way to install open source Unix software on Mac OS X

With Terminal, you'll access areas of your Mac that you just can't get to from the desktop. You may find yourself turning to Terminal for greater efficiency on a particular task or to use one of the thousands of open source programs that are now available to you. Unix continues to thrive as an operating system because of its power, flexibility, and simplicity, and the vast community that supports it. Learning Unix for Mac OS X, Second Edition can be your key to understanding all of it. The book has been reviewed by Apple for technological accuracy and brandishes the Apple Development Connection (ADC) logo.

Table of contents

  1. Learning Unix for Mac OS X, 2nd Edition
    1. Preface
      1. Mac OS X and the Unix Family of Operating Systems
      2. Versions of Unix
      3. Interfaces to Unix
      4. What This Handbook Covers
      5. Format
        1. Graphical User Interface Features
        2. Unix Commands
        3. Examples
        4. Problem Checklist
        5. Exercises
      6. Comments and Questions
      7. The Evolution of This Book
      8. Acknowledgments for Dave Taylor
      9. Acknowledgments for Brian Jepson
    2. 1. Getting Started
      1. Working in the Unix Environment
        1. The Shell Prompt
        2. Entering a Command Line
          1. date
          2. who
        3. Recalling Previous Commands
        4. Correcting a Command Line
        5. Ending Your Session
          1. Problem checklist
      2. Syntax of Unix Command Lines
        1. Exercise: Entering a Few Commands
      3. Types of Commands
      4. The Unresponsive Terminal
    3. 2. Using Unix
      1. The Mac OS X Filesystem
        1. Your Home Directory
        2. Your Working Directory
        3. The Directory Tree
        4. Absolute Pathnames
        5. Relative Pathnames
          1. Pathname puzzle
          2. Relative pathnames up
        6. Changing Your Working Directory
          1. pwd
          2. cd
        7. Files in the Directory Tree
        8. Listing Files with ls
        9. Calculating File Size
        10. Completing File and Directory Names
        11. Exercise: Exploring the Filesystem
        12. Looking Inside Files with less
      2. Protecting and Sharing Files
        1. Directory Access Permissions
        2. File Access Permissions
        3. Setting Permissions with chmod
          1. Problem checklist
        4. Changing Group and Owner
        5. Changing Your Password
      3. Superuser Privileges with sudo
      4. Graphical Filesystem Browsers
    4. 3. File Management
      1. File and Directory Names
      2. File and Directory Wildcards
      3. Creating and Editing Files
        1. Text Editors and Word Processors
        2. The vi Text Editor
          1. vi tour
      4. Managing Your Files
        1. Creating Directories with mkdir
        2. Copying Files
          1. cp
          2. Problem checklist
          3. Copying Mac files with resources
        3. Renaming and Moving Files with mv
        4. Finding Files
        5. Removing Files and Directories
          1. rm
          2. rmdir
          3. Problem checklist
        6. Files on Other Operating Systems
    5. 4. Customizing Your Session
      1. Launching Terminal
        1. Changing Terminal Preferences
          1. Shell
          2. Processes
          3. Emulation
          4. Buffer
          5. Display
          6. Color
          7. Window
      2. Customizing Your Shell Environment
        1. Changing Your Prompt
        2. Creating Aliases
        3. Setting the Terminal Title
        4. Using AppleScript to Manipulate the Terminal
      3. Further Customization
    6. 5. Printing
      1. Formatting and Print Commands
        1. pr
        2. enscript
        3. lpr
          1. Problem checklist
        4. Viewing the Printer Queue
          1. lpq
          2. lprm
        5. atprint
      2. Non-PostScript Printers
    7. 6. Redirecting I/O
      1. Standard Input and Standard Output
        1. Putting Text in a File
          1. cat
      2. Pipes and Filters
        1. grep
        2. sort
        3. Piping to a Pager
        4. Exercise: Redirecting Input/Output
    8. 7. Accessing the Internet
      1. Remote Logins
        1. Web and FTP Access
        2. Remote Access to Other Unix Systems
        3. About Security
      2. Transferring Files
        1. scp and rcp
        2. FTP
          1. Command-line ftp
          2. SFTP: FTP to secure sites
          3. FTP with a web browser
          4. Other FTP solutions
        3. Practice
    9. 8. Unix-Based Internet Tools
      1. Fink
        1. Installing Packages
        2. Listing Available Packages
      2. Lynx, a Text-Based Web Browser
      3. Electronic Mail with Pine
        1. Configuring Pine
          1. Configuring Pine to send and receive email
        2. Reading Email with Pine
        3. Sending Email with Pine
          1. Pine address book
        4. Exercise: Sending and Reading Mail
      4. Usenet News
      5. Interactive Chat
        1. talk
        2. IRC
          1. Introducing IRC
          2. A sample IRC session
    10. 9. Multitasking
      1. Running a Command in the Background
      2. Checking on a Process
        1. ps
      3. Canceling a Process
        1. kill
          1. Problem checklist
    11. 10. Where to Go from Here
      1. Documentation
        1. The man Command
          1. Problem checklist
        2. Documentation via the Internet
        3. Books
      2. Shell Aliases and Functions
      3. Programming
    12. Glossary
    13. Index
    14. Colophon

Product information

  • Title: Learning Unix for Mac OS X, Second Edition
  • Author(s): Brian Jepson, Dave Taylor
  • Release date: December 2002
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596004705