ebook img

Unix for Mac: your visual blueprint for maximizing the foundation of Mac OS X PDF

356 Pages·2003·28.057 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Unix for Mac: your visual blueprint for maximizing the foundation of Mac OS X

53730X Cover_rb2.qxp 3/18/03 12:28 PM Page 1 Perfect bind Trim:8 X 9Bleed:.25”4-color process plus Pantone 2945 cv Matte layflat Productivity tools and much more on CD-ROM! Welcome to the only guidebook series that takes a visual •OpenOffice.org,a free office approach to professional-level computer topics.Open the book productivity software suite Unix for Mac and you’ll discover step-by-step screen shots that demonstrate •Gimp,a GNU image manipulation program over 160 key Unix tasks you can do on Mac OS X,including: ® ® •XFree86 to run X Window System applications • Using the terminal application • Using system administration •Plus a searchable e-version of U commands • Navigating the file system the book • Installing and using Internet • Working with pico,vi,and emacs applications text editors n • Running the X Window System • Customizing the shell • Developing new Unix applications i • Writing shell scripts x • Sharing files between computers ® f o r M a c ® “Apply It” and “Extra” High-resolution screen Succinct explanations Two-page lessons Henry-Stocker sidebars highlight shots demonstrate walk you through break big topics into Bartlett Your visual blueprint to maximizing ™ useful tips each task step by step bite-sized modules the foundation of Mac OS®X ISBN 0-7645-3730-X $26.99 USA *85555-IGFGGc www.wiley.com/compbooks ,!7IA7G4-fdhdab!:p;m;Q;t;T $39.99 CAN Productivity tools and more on CD-ROM! £18.95 UK Category: • OpenOffice.org,Gimp,XFree86,Fink,and other Operating Systems/General open source software System requirements: Power PC running OS X. See the What’s on the CD-ROM Appendix for • A searchable e-version of the book and more details and complete system requirements. 53730X FM.qxd 3/25/03 1:43 PM Page i   Unix for Mac Your visual blueprintTM to maximizing  the foundation for Mac OS X by Sandra Henry-Stocker and Kynn Bartlett TM From ® & 53730X FM.qxd 3/25/03 1:43 PM Page ii UNIX®for Mac®: Your visual blueprintTM to maximizing the foundation of Mac OS®X Published by FOR PURPOSES OF ILLUSTRATING THE CONCEPTS AND Wiley Publishing, Inc. TECHNIQUES DESCRIBED IN THIS BOOK, THE AUTHOR HAS 909 Third Avenue CREATED VARIOUS NAMES, COMPANY NAMES, MAILING, E-MAIL New York, NY 10022 AND INTERNET ADDRESSES, PHONE AND FAX NUMBERS AND SIMILAR INFORMATION, ALL OF WHICH ARE FICTITIOUS. ANY Published simultaneously in Canada RESEMBLANCE OF THESE FICTITIOUS NAMES, ADDRESSES, Copyright © 2003 by Wiley Publishing, Inc., Indianapolis, Indiana PHONE AND FAX NUMBERS AND SIMILAR INFORMATION TO ANY ACTUAL PERSON, COMPANY AND/OR ORGANIZATION IS Certain designs and text Copyright © 1992-2003 maranGraphics, UNINTENTIONAL AND PURELY COINCIDENTAL. Inc., used with maranGraphics' permission. maranGraphics, Inc. Important Numbers 5755 Coopers Avenue Mississauga, Ontario, Canada For U.S. corporate orders, please call maranGraphics at L4Z 1R9 800-469-6616 or fax 905-890-9434. No part of this publication may be reproduced, stored in a retrieval For general information on our other products and services or system or transmitted in any form or by any means, electronic, to obtain technical support please contact our Customer Care mechanical, photocopying, recording, scanning or otherwise, except Department within the U.S. at 800-762-2974, outside the U.S. as permitted under Sections 107 or 108 of the 1976 United States at 317-572-3993 or fax 317-572-4002. Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per- copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Permissions Danvers, MA 01923, (978) 750-8400, fax (978) 646-8700. Requests maranGraphics to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Certain text and illustrations by maranGraphics, Inc., used Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4447, with maranGraphics' permission. E-mail: [email protected]. Library of Congress Control Number: 2003101791 ISBN: 0-7645-3730-X Truly a 19thcentury architectural wonder, London's Tower Bridge took Manufactured in the United States of America 432 construction workers eight years to build. Architect HoraceJones designed the massive bascule bridge—a type of counterweighted 10 9 8 7 6 5 4 3 2 1 drawbridge—and at its completion in 1894, it was the largest and most sophisticated of its kind ever built. Discover more about London's 1V/RX/QU/QT/IN historic architecture in Frommer's London 2003,available wherever books are sold or at www.frommers.com Trademark Acknowledgments Wiley, the Wiley Publishing logo, Visual, the Visual logo, Visual Blueprint, Read Less - Learn More and related trade dress are trademarks or registered trademarks of Wiley Publishing, Inc. in theUnited States and other countries and may not be used without written permission. The maranGraphics logo is a trademark or registered trademark of maranGraphics, Inc. UNIX is a trademark ofAmerican Telephone and Telegraph Company. Mac OS is a trademark of Apple Computer, Inc. All other trademarks are the property of their respective owners. Wiley Publishing, Inc. and maranGraphics, Inc. are not associated with any product or vendor mentioned in this book. is a trademark of Wiley Publishing, Inc. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: WHILE THE PUBLISHER AND AUTHOR HAVE USED THEIR BEST EFFORTS IN PREPARING THIS BOOK, THEY MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS BOOK AND SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTIES OF MERCHANTABILITY U.S. Corporate Sales U.S. Trade Sales OR FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES REPRESENTATIVES OR WRITTEN SALES MATERIALS. THE ADVICE AND STRATEGIES Contact maranGraphics Contact Wiley CONTAINED HEREIN MAY NOT BE SUITABLE FOR YOUR SITUATION. YOU SHOULD CONSULT WITH A PROFESSIONAL WHERE APPROPRIATE. NEITHER THE PUBLISHER NOR AUTHOR at (800) 469-6616 or at (800) 762-2974 SHALL BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, fax (905) 890-9434. or fax (317) 572-4002. INCLUDING BUT NOT LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES. 53730X FM.qxd 3/25/03 1:43 PM Page iii P V ... RAISE FOR ISUAL BOOKS This is absolutely the best computer-related book I have ever I have quite a few of your Visual books and have been bought. Thank you so much for this fantastic text. Simply the very pleased with all of them. I love the way the lessons are best computer book series I have ever seen. I will look for, presented! recommend, and purchase more of the same. –Mary Jane Newman (Yorba Linda, CA) –David E. Prince (NeoNome.com) I am an avid fan of your Visual books. If I need to learn I have always enjoyed your Visual books, as they provide a anything, I just buy one of your books and learn the topic in quick overview of functions. Visual books are helpful even no time. Wonders! I have even trained my friends to give me for technically inclined individuals who don’t have the time to Visual books as gifts. read thick books in order to get the job done. As a frequent traveler, I am extremely grateful to you for providing a pdf –Illona Bergstrom (Aventura, FL) version of each book on a companion CD-ROM. I can easily refer to your book while on the road without much additional I just had to let you and your company know how great I weight. think your books are. I just purchased my third Visual book (my first two are dog-eared now!) and, once again, your –Kin C. Wong (Calgary, Alberta, Canada) product has surpassed my expectations. The expertise, thought, and effort that go into each book are obvious, and I I just want to let you know that I really enjoy all your books. sincerely appreciate your efforts. I’m a strong visual learner. You really know how to get people addicted to learning! I’m a very satisfied Visual –Tracey Moore (Memphis, TN) customer. Keep up the excellent work! Compliments to the chef!! Your books are extraordinary! Or, –Helen Lee (Calgary, Alberta, Canada) simply put, extra-ordinary, meaning way above the rest! THANK YOU THANK YOU THANK YOU! I buy them for friends, These Visual Blueprints are great books! I just purchased family, and colleagues. ASP 3.0 – it could not have introduced programming with ASP any easier! –Christine J. Manfrin (Castle Rock, CO) –Joseph Moglia (St. Louis, MO) I write to extend my thanks and appreciation for your books. They are clear, easy to follow, and straight to the point. This book is PERFECT for me - it’s highly visual and gets Keep up the good work! I bought several of your books and right to the point. What I like most about it is that each they are just right! No regrets! I will always buy your books page presents a new task that you can try verbatim or, because they are the best. alternatively, take the ideas and build your own examples. Also, this book isn’t bogged down with trying to “tell all” – –Seward Kollie (Dakar, Senegal) it gets right to the point. This is an EXCELLENT, EXCELLENT, EXCELLENT book and I look forward purchasing other books Thank you for making it clear. Keep up the good work. in the series. –Kirk Santoro (Burbank, CA) –Tom Dierickx (Malta, IL) 3 0 Feb 53730X FM.qxd 3/25/03 1:43 PM Page iv maranGraphics is a family-run business located near Toronto, Canada. At maranGraphics, we believe in producing great rebuild every screen shot to provide the best clarity computer books — one book at a time. possible, making our screen shots the most precise and easiest to read in the industry. We strive for perfection, maranGraphics has been producing high-technology and believe that the time spent handcrafting each products for over 25 years, which enables us to offer the element results in the best computer books money computer book community a unique communication canbuy. process. Thank you for purchasing this book. We hope you Our computer books use an integrated communication enjoy it! process, which is very different from the approach used in other computer books. Each spread is, in essence, a Sincerely, flow chart — the text and screen shots are totally incorporated into the layout of the spread. Introductory Robert Maran text and helpful tips complete the learning experience. President maranGraphics' approach encourages the left and right maranGraphics sides of the brain to work together — resulting in faster [email protected] orientation and greater memory retention. www.maran.com Above all, we are very proud of the handcrafted nature of our books. Our carefully-chosen writers are experts in their fields, and spend countless hours researching and organizing the content for each topic. Our artists 53730X FM.qxd 3/25/03 1:43 PM Page v CREDITS Project Editors Book Design Kathleen McFadden maranGraphics® Jade L. Williams Layout Acquisitions Editor Carrie Foster Jody Kennen LeAndra Johnson Joyce Haughey Kristin McMullan Product Development Manager Heather Pope Lindsay Sandman Screen Artist Copy Editors Jill A. Proll Jill Mazurczyk Marylouise Wiack Cover Illustration David E. Gregory Technical Editor Erick Tejkowski Proofreader Laura L. Bowman Editorial Manager Rev Mengle Quality Control John Tyler Connoley Andy Hollandbeck Permissions Editor Angel Perez Laura Moss Indexer Media Development Specialist Joan Griffitts Gregory Stafford Vice President and Executive Manufacturing Group Publisher Allan Conley Richard Swadley Linda Cook Paul Gilchrist Vice President and Publisher Jennifer Guynn Barry Pruett Production Coordinator Composition Director Nancee Reeves Debbie Stailey 53730X FM.qxd 3/25/03 1:43 PM Page vi TABLE OF CONTENTS HOW TO USE THIS BOOK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xii 1) GET STARTED WITH UNIX Introduction to Unix ............................................................................................................2 Start the Terminal Application ............................................................................................4 Configure the Terminal Application ..................................................................................6 Enter Unix Shell Commands ..............................................................................................8 Shell Command Concepts ................................................................................................10 Read the Unix Manual ......................................................................................................12 Exit the Terminal Window ................................................................................................14 2) WORK WITH FILES List Files ..............................................................................................................................16 Show Hidden Files ............................................................................................................17 Show File Attributes ..........................................................................................................18 Copy A File ........................................................................................................................20 Designate Files by Pathname ............................................................................................21 Rename a File ....................................................................................................................22 Delete a File ........................................................................................................................23 Change File Permissions ....................................................................................................24 Select Files Using Wildcards ............................................................................................26 Select Files Using Completion ..........................................................................................27 Find Files By Name ............................................................................................................28 3) WORK WITH DIRECTORIES Change the Current Directory ........................................................................................30 Create a Directory ............................................................................................................32 Delete a Directory ............................................................................................................34 Move Files into a Directory ..............................................................................................36 Copy a Directory ................................................................................................................37 Determine Directory Size ................................................................................................38 4) WORK WITH TEXT View Text Files ....................................................................................................................40 Create a Simple Text File ..................................................................................................41 View Text Files as Pages ....................................................................................................42 vi 53730X FM.qxd 3/25/03 1:43 PM Page vii Unix for Mac: Your visual blueprint to maximizing the foundation of Mac OS X View Portions of a Text File ..............................................................................................44 Extract Text from a File ......................................................................................................46 Redirect Text to a File ........................................................................................................48 Chain Text Commands Together ......................................................................................50 Compare Text Files ............................................................................................................52 Count Characters,Lines,and Words in Text ..................................................................54 Arrange Text in Columns ..................................................................................................55 Sorting Text ........................................................................................................................56 Print Text on a Printer ........................................................................................................58 5) WORK WITH TEXT EDITORS Open a File with Pico ........................................................................................................60 Edit a File with Pico ..........................................................................................................62 Open a File with vi ............................................................................................................64 Movement Within vi ..........................................................................................................66 Enter Text in vi ....................................................................................................................68 Delete Text in vi ................................................................................................................70 Edit Text with vi ..................................................................................................................72 Save a File with vi ..............................................................................................................74 Open a File with emacs ....................................................................................................76 Edit a File with emacs ........................................................................................................78 6) CUSTOMIZE YOUR SHELL Set Your Prompt ................................................................................................................80 Set Command Aliases ........................................................................................................82 Set Shell Variables ..............................................................................................................84 Set Environment Variables ................................................................................................86 Set Your Path ......................................................................................................................88 Edit Your .tcshrc File ..........................................................................................................89 Recall Your Command History ........................................................................................90 Start a New Shell ..............................................................................................................92 Change Your Shell ..............................................................................................................93 Work with the Bourne-Again Shell ..................................................................................94 Work with the Z Shell ......................................................................................................95 7) WORK WITH PROCESSES Suspend the Current Process ..........................................................................................96 Restart a Process ................................................................................................................98 vii 53730X FM.qxd 3/25/03 1:43 PM Page viii TABLE OF CONTENTS Run a Process in the Background ..................................................................................100 Kill a Process ....................................................................................................................102 List Active Processes ........................................................................................................104 Monitor the Top Processes ............................................................................................106 8) AUTOMATE SHELL TASKS Write a Simple Shell Script ............................................................................................108 Run a Simple Shell Script ................................................................................................110 Write Looping Shell Scripts ............................................................................................112 Write A Conditional Shell Script ....................................................................................114 Extract Information with awk ........................................................................................116 Extend Scripts with sed ..................................................................................................118 Schedule Scripts to Run Automatically ........................................................................120 9) COMBINE UNIX AND AQUA Open Aqua Applications from the Shell ........................................................................122 Capture a Screenshot from Unix ....................................................................................124 Access the Aqua Clipboard ............................................................................................126 Copy Apple Resource Forks ............................................................................................128 Run Applescript from the Shell ......................................................................................130 Create Clickable Shell Scripts ........................................................................................132 Drag Pathnames to the Terminal Window ....................................................................133 10) WORK WITH INTERNET COMMANDS Connect to the Internet ..................................................................................................134 Look Up an Internet Address ..........................................................................................136 Look Up Domain Information ........................................................................................138 Examine Your Network Connection ..............................................................................140 Check that Another Computer Is Reachable ................................................................142 Log on to Another Computer ........................................................................................144 Transfer Files ....................................................................................................................146 Access Another Computer Securely ..............................................................................148 Download Web Files ......................................................................................................150 Enable Remote Access to Your Computer ....................................................................152 viii

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.