Learning Unix for Mac OS X 2002.Pdf

Learning Unix for Mac OS X 2002.Pdf

ti iAIDICI Apple Developer Connection Recommended Title Learning 8.99. 19.95 II II Ill II IIIII Ill IIIII Ill 040027-00-·~ l!A' [11:~ STffi( 11054 MAC 1>54 (t~2B J.L·'.ciiD ~19'13 O'REILLY® Learning Unix for Mac OS X Related Mac OS XTitles from O'Reilly Essentials Unix Essentials AppleScript in a Nutshell Using csh & tcsh Building Cocoa Applications: Unix in a Nutshell A Step-by-Step Guide Unix Power Tools Learning Carbon Learning GNU Emacs Learning Cocoa Learning the vi Editor Mac OS X Pocket Reference REALbasic: The Definitive Guide Related Programming Developing Java Beansr"' Missing Manuals Java TM Cookbook AppleWorks 6: The Missing JavaTM I/0 Manual JavaTM Network Programming iMovie 2: The Missing Manual Java TV in a Nutshell Mac OS 9: The Missing Manual Learning Java TV Mac OS X: The Missing Manual Learning Perl Office 2001 for Macintosh: Perl in a Nutshell The Missing Manual Practical C Programming Office X for Macintosh: Programming with Qt The Missing Manual Mac OS XAdministration Apache: The Definitive Guide Essential System Administration sendmail Learning Unix for Mac OS X Dave Taylor and jerry Peek with Grace Todino and john Strang O'REILLY® Beijing • Cambridge • Farnham • Koln • Paris • Sebastopol • Taipei • Tokyo Learning Unix for Mac OS X by Dave Taylor and Jerry Peek Copyright© 2002 O'Reilly & Associates, Inc. All rights reserved. Printed in the United States of America. Published by O'Reilly & Associates, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O'Reilly & Associates books may be purchased for educational, business, or sales pro­ motional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editor: Laurie Petrycki Production Editor: Linley Dolby Cover Designer: Emma Colby Interior Designer: David Futato Printing History: May2002: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of an Alaskan malamute and the topic of Mac OS X is a trademark of O'Reilly & Associates, Inc. Apple Computer, Inc. boldly combined open source technologies with its own programming efforts to create Mac OS X, one of the most versatile and stable operating systems now available. In the same spirit, Apple has joined forces with O'Reilly & Associates, Inc. to bring you an indispensable collection of technical publications. The ADC logo indicates that the book has been technically reviewed by Apple engineers and is recommended by the Apple Developer Connection. Apple, the Apple logo, AppleScript, AppleTalk, Apple Works, Cocoa, Finder, Mac, Macintosh, MPW, QuickDraw, QuickTime, and Sherlock are trademarks of Apple Computer, Inc., registered in the United States and other countries. Aqua, Carbon, and Quartz are trademarks of Apple Computer, Inc. While every precaution has been taken in the preparation of this book, the publisher and the authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN: 0-596-00342-0 [M] [11/02] Table of Contents Preface . vii 1. Getting Started . 1 Working in the Unix Environment 1 Syntax of Unix Command Lines 7 Types of Commands 10 The Unresponsive Terminal 11 2. Using Unix ................................................. 13 The Unix Filesystem 13 Looking Inside Files with less 24 Protecting and Sharing Files 26 Graphical Filesystem Browsers 31 Completing File and Directory Names 32 3. File Management .......................................... 33 File and Directory Names 33 File and Directory Wildcards 34 Creating and Editing Files 36 Managing Your Files 42 4. Customizing Your Session . SO Launching Terminal 50 Customizing Your Shell Environment 55 Further Customization 60 v S. Printing ................................................... 61 Formatting and Print Commands 61 Configuring Your LPR Printer 67 6. Redirecting 1/0 . 72 Standard Input and Standard Output 72 Pipes and Filters 7 6 7. Accessing the Internet ...................................... 81 Remote Logins 81 Transferring Files 84 8. Unix-Based Internet Tools . 91 Lynx, a Text-Based Web Browser 91 Electronic Mail 93 UsenetNews 103 Interactive Chat 107 9. Multitasking .............................................. 114 Running a Command in the Background 114 Checking on a Process 116 Canceling a Process 118 10. Where to Go from Here ..................................... 120 Documentation 120 Shell Aliases and Functions 123 Programming 123 Appendix: Configuring Sendmail .................................. 125 Glossary ....................................................... 127 Index .......................................................... 131 vi I Table of Contents Preface Mac OS X (pronounced "Mac OS Ten"), the latest incarnation of the Macin­ tosh operating system, is a radical departure from previous versions. Not only is there a whole new look and feel (dubbed "Aqua"), there are huge dif­ ferences under the hood. All the old, familiar Macintosh system software has been replaced with another operating system, called Unix. Unix is a mul­ tiuser, multitasking operating system. Being multiuser means Mac OS X allows multiple users to share the same system, each having the ability to customize the desktop, create files that can be kept private from other users, and to make settings that will automatically be restored whenever that per­ son uses the computer. Being multitasking means the computer can easily run many different applications at the same time, and that if one applica­ tion crashes or hangs, the entire system doesn't need to be rebooted. The fact that Mac OS X is Unix under the hood doesn't matter to users who simply want to use its slick graphical interface to run their applications or manage their files. But it opens up worlds of possibilities for users who want to dig a little deeper. The Unix command-line interface, which is accessible through a Mac application called the Terminal, provides an enormous amount of power for advanced users. What's more, once you've learned to use Unix in OS X, you'll also be able to use the command line in other ver­ sions of Unix such as Linux. This book is designed to teach the basics of Unix to Macintosh users. We tell you how to use the command line (which Unix users refer to as "the shell") and the filesystem, as well as some of the most useful commands. Unix is a complex and powerful system, so we only scratch the surface, but we also tell you how to deepen your Unix knowledge once you're ready for more. vii Mac OS Xand the Unix Family of Operating Systems The Macintosh staned out with a single-tasking operating system that allowed simple switching between applications through an application called the Finder. More recent versions of Mac OS have supported multiple applications running simultaneously, but it wasn't until the landmark release of Mac OS X that true multitasking arrived in the Macintosh world. With OS X, Macintosh applications run in separate memory areas. A true multiuser system that includes proper file-level security is also finally part of the Mac. To accomplish these improvements, Mac OS X made the jump from a pro­ prietary underlying operating environment to Unix. Mac OS X is built on top of Darwin, a version of Unix based on BSD 4.4, FreeBSD, and the Mach micro kernel. Unix itself was invented more than 30 years ago for scientific and profes­ sional users who wanted a very powerful and flexible OS. It has evolved. since then through a remarkably circuitous path, with stops at Bell Tele­ phone Labs, UC Berkeley, research centers in Australia and Europe, and the U.S. Department of Defense Advanced Research Projects Agency (for fund­ ing). Because Unix was designed for experts, it can be a bit overwhelming at first. But after you get the basics (from this book!) you'll start to appreciate some of the reasons to use Unix: • It comes with a huge number of powerful application programs. You can get many others for free on the Internet. (The GNU utilities, avail­ able from the Free Software Foundation (ht~:llwww.fsf.org/), are very popular.) You can thus do much more at a much lower cost. • Not only are the applications often free, but some Unix versions are also free. Linux is a good example. Like the free applications, most free Unix versions are of excellent quality. They're maintained by volunteer pro­ grammers who want a powerful OS and are frustrated by the slow, bug­ ridden OS development at some big software companies. With Mac OS X, Unix is also "free" as part of the operating system, and many people use Mac OS X daily without ever knowing about all the power lurking under the hood. • Unix runs on almost any kind of computer, from tiny embedded sys­ tems to giant supercomputers. After you read this book, you'll not only know all about Darwin, but you '11 also be ready to use many other kinds of Unix-based computers without learning a new OS for each one. viii I Preface • In general, Unix (especially without a windowing system) is less resource intensive than other major operating systems. For instance, Linux will run happily on an old system with a x386 microprocessor and let multiple users share the same computer. (Don't bother trying to use the latest versions of Microsoft Windows on a system that's more than a few years old!) If you need a windowing system, Unix lets you choose from modern feature-rich interfaces as well as from simple ones that need much less system power.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    162 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us