| Home Catalog FAQ | Log In |
Bundle Discount!
Save 30% when you build your own bundle of three or more books, including Take Control of...
(30% discount overrides other coupons and is calculated on the first screen of our cart.)
Take Control of the Mac Command Line with Terminal
Learn how to release your inner geek!
If you've ever thought you should learn how to use the Unix command line that underlies Mac OS X, or felt at sea when typing commands into Terminal, Joe Kissell is here to help! This 116-page ebook will help you become comfortable working on the Mac's command line, starting with the fundamentals and walking you through more advanced topics as your knowledge increases. And if you're uncertain how to put your new-found skills to use, Joe includes numerous real-life "recipes" for tasks that are best done from the command line.
"I found the answers to many questions I had in your book, and I enjoyed reading it. I am definitely more confident now in facing the Mac command line. Thank you for the time and art that you spent to create such a clarifying text."
—Mona Hosseini, grad student in Genomic Medicine and Statistics at the University of Oxford
The book begins by teaching you these core concepts:
Next, it's on to the command line, where you'll learn:
You'll extend your skills as you discover how to:
Questions answered include:
"Very good!
A pleasure to read, the right balance of coverage and clarity." —Brian G.
Finally, to help you put it all together, the book showcases 40 real-world "recipes" that combine commands you've learned to perform useful tasks, such as listing users who've logged in recently, figuring out why a disk won't eject, changing filename extensions, copying the source code of a Web page, downloading a file via FTP, determing which programs have open connections to the Internet, learning details about a domain name, and deleting stubborn items from the Trash.
Book Info
iPad & KindleAn EPUB is available to purchasers of this title; log in to your account to download it. More info... A Mobipocket file is available to purchasers of this title; log in to your account to download it. More info... |
About the Author
|
Book Reviews
Author Interviews
|
Table of Contents
|
Read Me FirstWelcome to Take Control of the Mac Command Line with Terminal! This book introduces you to Mac OS X’s command line environment, teaching you how to use the Terminal utility to accomplish useful, interesting tasks that are either difficult or impossible to perform in the graphical interface. The book was written by Joe Kissell, edited by Geoff Duncan, and published by TidBITS Publishing Inc. |
Back when I began using computers, in the early 1980s, user interfaces were pretty primitive. A computer usually came with only a keyboard for input—mice were a novelty that hadn’t caught on yet. To get your computer to do something, you typed a command, waited for some result, and then typed another command. There simply was no concept of pointing and clicking to make things happen.
When I finally switched from DOS to the Mac (without ever going through a Windows phase, I should mention!), I was thrilled that I could get my work done without having to memorize lists of commands, consult manuals constantly, or guess at how to accomplish something. Everything was right there on the screen, just a click away. It was simpler—not in the sense of being less powerful, but in the sense of requiring less effort to access the same amount of power. Like most everyone else, I fell instantly in love with graphical interfaces.
Fast forward a couple of decades, and I find myself faced with some mundane task, such as renaming all 500 files in a folder to use a different extension, deleting a file that refuses to disappear from the Trash, or changing an obscure system preference. After wasting some time puzzling over how to accomplish my task—and perhaps doing some Web searches—I finally discover that Mac OS X’s graphical interface does not, in fact, offer any built-in way to do what I want. So I have to hunt on the Internet for an application that seems to do what I want, download it, install it, and run it (and perhaps pay for it, too), all so that I can accomplish a task with my mouse that would have taken me 5 seconds in DOS 25 years ago.
That’s not simple.
I’m a Mac user because I don’t have time to waste. I don’t want my computer to put barriers between me and my work. I want easier ways to do things instead of harder ways. Ironically, Mac OS X’s beautiful Aqua graphical interface, with all its menus, icons, and buttons, doesn’t always provide the easiest way to do something, and in some cases it doesn’t even provide a hard way. The cost of elegance and simplicity is sometimes a lack of flexibility.
Luckily, Mac OS X isn’t restricted to the graphical realm of windows and icons. It has another whole interface that lets you accomplish many tasks that would otherwise be difficult, or even impossible. This other way of using Mac OS X looks strikingly like those DOS screens from the 1980s: it’s a command-line interface, in which input is done with the keyboard, and the output is sent to the screen in plain text.
The usual way of getting to this alternative interface (though there are others) is to use a program called Terminal, located in the Utilities folder inside your Applications folder. It’s a simple program that doesn’t appear to do much at first glance—it displays a window with a little bit of text in it. But Terminal is in fact the gateway to vast power.
If you read TidBITS, Take Control books, Macworld, or any of the numerous other publications about the Mac, you’ve undoubtedly seen tips and tricks from time to time that begin, “Open Terminal and type in the following…”. Many Mac users—especially those without prior experience in DOS or Unix—find that sort of thing intimidating. What do I click on? How do I find my way around? How do I stop something I’ve started? Without the visual cues of a graphical interface, lots of people get stuck staring at that blank window, frustrated that they can’t accomplish whatever task they’re trying to perform.
If you’re one of those people, this book is for you. It’s also for people who know a little bit about the command line—perhaps just enough to be dangerous—but don’t fully understand what they can do, how to get around, and how to stay out of trouble. By the time you’re finished reading this book and trying out the examples I give, you should be comfortable interacting with your Mac by way of the command line, ready to confidently use Terminal whenever the need arises.
It’s not scary. It’s not hard. It’s just different. And don’t worry—I’ll be with you every step of the way!
Much of this book is concerned with teaching you the skills and basic commands you must know in order to accomplish genuinely useful things later on. If you feel that it’s a bit boring or irrelevant to learn how to list files or change directories, remember: it’s all about the end result. You learn the fundamentals of baking not because measuring flour or preheating an oven is intrinsically interesting, but because you need to know how to do those things in order to end up with cookies. And let me tell you, the cookies make it all worthwhile!
Speaking of food—my all-purpose metaphor—this book doesn’t only provide information on individual ingredients and techniques. The last section is full of terrific, simple command-line recipes that put all this power to good use while giving you a taste of some advanced capabilities I don’t explore in detail. Among other things, you’ll learn:
Astute readers may note that some of these tasks can be accomplished with third-party utilities (most of which simply carry out command-line tasks in response to a mouse click). That’s true, but the command line is infinitely more flexible—and Terminal is free! It’s like the difference between buying supermarket cookies and being able to bake your own—in any variety, and in any quantity. Sure, there’s a place for prepackaged solutions, but it’s often quicker, easier, and more effective just to type a command into Terminal.
I should be clear, however, that this book won’t turn you into a command-line expert. I would need thousands of pages to list everything you can accomplish using the command line. Instead, my goal is to cover the basics and get you up to a moderate level of familiarity and competence. I may not answer every question you have, but you should get a solid foundation and be able to figure out how to learn more. I’ll take your feedback into account, too: if there’s sufficient interest, I may expand on this information in a future version of this book (or another Take Control title).
Most of the examples in this book work with any version of Mac OS X, but a few of them require Mac OS X 10.5 Leopard or newer. If you’re following along in Mac OS X 10.4 Tiger or earlier, you’ll notice that the Terminal application isn’t identical—it omits tabs and some other customization options—but mostly works the same.
This book is almost entirely linear—later sections build on earlier sections. I strongly recommend starting from the beginning and working through the book in order (perhaps skimming lightly over any sections that explain already-familiar concepts). You can use the items in the final section, Command-Line Recipes, at any time, but they’ll make more sense if you understand all the basics presented earlier in the book.
Version 1.1 is a minor update intended primarily for compatibility with versions of Mac OS X released since the book was first published (10.6 Snow Leopard, 10.7 Lion, and 10.8 Mountain Lion), as well as to correct a few small errors and broken URLs, and to adopt the latest Take Control formatting. I also made the following small adjustments:
Most of the examples in this book work with any version of Mac OS X, but a few of them require Mac OS X 10.5 Leopard or newer. If you’re following along in Mac OS X 10.4 Tiger or earlier, you’ll notice that the Terminal application isn’t identical—it omits tabs and some other customization options—but mostly works the same.
Absolutely! This ebook was written with you in mind.
Most of this ebook will be too easy for you, sorry. It is possible that we'll publish a more advanced edition in the future.
There are lots of great ways to read our ebooks on these devices. For more details, please read our latest Device Advice.
Feel free to ask us if you have a question about this title!
How could we not publish such kind words? If you'd like to send us your comments (good or bad, though we hope they're all good), just click the Feedback link on the cover of your copy of the ebook. Be sure to let us know if we can publish your comment. Thanks!
I purchased this book a while back, just in case I needed to refresh Unix skills. However, the “tyranny of the immediate” (stuff we have to do NOW) kept me from doing much in terminal. However, in past couple days, I actually NEEDED to do some work in Terminal. Thus, I went through your whole book. It reminded me of a lot of things I had forgotten from 15 years ago, and presented some that I never knew. Thanks for this work, it is both informative and readily comprehensible.
I just wanted to say thank you. I expected to slog through the book and not derive a lot of pleasure out of it. I was very wrong. I almost worked through it all in one sitting, and I now find myself enjoying working in the command line! I never imagined this would end up being the case.
November 5, 2013 -- We have no specific plans to update this ebook in the near future. When asked if this ebook will still work nicely for someone running OS X 10.9 Mavericks, author Joe Kissell replied, "To the best of my knowledge, none of the changes in Mavericks affect my Command Line book. There are some new commands, but as far as I know, everything I talk about that worked in Mountain Lion continues to work identically in Mavericks. We have no immediate plans to update the existing book because everything still works."
—Tonya J Engst
August 16, 2012 --
Safari 6.0, which Apple released into the wild at the same time it did Mountain Lion, lacks the preference option, present in earlier versions, for setting the default proportional font and fixed-width fonts. Fortunately, you can still set them using a series of defaults commands in Terminal. To find out how, see the TidBITS article Fix Your Fonts in Safari 6.
—Michael E. Cohen
Visit our catalog to see all the other books we publish!
Teach classes? Check out our discounted class copy pricing!
Orders are processed for us by eSellerate on a secure site.
Copyright 2014 TidBITS Publishing Inc. | Privacy Policy | Contact | Follow on Twitter
