Preface

Mac OS X (pronounced “Mac OS Ten”), the latest incarnation of the Macintosh operating system, is a radical departure from previous versions. Not only is there a whole new look and feel (dubbed “Aqua”), there are huge differences under the hood. All the old, familiar Macintosh system software has been replaced with another operating system, called Unix. Unix is a multiuser, 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 person uses the computer. Being multitasking means the computer can easily run many different applications at the same time, and that if one application 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 Mac OS X, you’ll also be able to use the command line in other versions of Unix or the Unix-compatible 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.

Mac OS X and the Unix Family of Operating Systems

The Macintosh started 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 Mac 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 proprietary underlying operating environment to Unix. Mac OS X is built on top of Darwin, a version of Unix based on BSD 4.4 Lite, FreeBSD, NetBSD, and the Mach microkernel.

Unix itself was invented more than 30 years ago for scientific and professional users who wanted a very powerful and flexible OS. It has evolved since then through a remarkably circuitous path, with stops at Bell Telephone Labs, UC Berkeley, research centers in Australia and Europe, and the U.S. Department of Defense Advanced Research Projects Agency (for funding). 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 Fink project, available from SourceForge (http://fink.sourceforge.net/), brings many open source packages to Mac OS X.) You can thus do much more at a much lower cost.

  • Not only are the applications often free, but some Unix (and Unix-compatible) operating systems are also free. Linux and FreeBSD are good examples. Like the free applications, most free Unix versions are of excellent quality. They’re maintained by volunteer programmers and corporations who want a powerful OS and are frustrated by the slow, bug-ridden OS development at some big software companies. Mac OS X’s Darwin core qualifies as a free Unix (you can get it at http://developer.apple.com/darwin/), but it does not have Mac OS X’s easy-to-use interface. 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 systems to giant supercomputers. After you read this book, you’ll not only know all about Darwin, but you’ll also be ready to use many other kinds of Unix-based computers without learning a new OS for each one.

  • 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 an Intel 80386 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. Anyone with limited resources — educational institutions, organizations in developing countries, and so on — can use Unix to do more with less.

  • Much of the Internet’s development was done on Unix systems. Many Internet web sites and Internet service providers use Unix because it’s so flexible and inexpensive. With powerful hardware, Unix really shines.

Get Learning Unix for Mac OS X, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.