1.1 Why Use Unix?

It's an obvious question, particularly if you're a long-time Macintosh person who is familiar and happy with the capabilities and logic of the graphical world, with its Aqua interface built on top of the Quartz rendering system. Dipping into the primarily text-based Unix tools on your Mac OS X system can give you even greater power and control over both your computer and your computing environment. There are other reasons, including that it's fun and there are thousands of open source and otherwise freely downloadable Unix-based applications, particularly for science and engineering. But, fundamentally, it's all about power and control .

As an example, consider the difference between the graphical Force Quit option on the Apple menu and the Unix programs ps and kill . While Force Quit is more attractive, as shown in Figure 1-1, notice that it lists only a very small number of applications.

Figure 1-1. Force Quit doesn't show all running applications

By contrast, the ps ( processor status ) command used from within the Terminal application (Applications Utilities Terminal) shows a complete and full list of every application, utility, and system process running on the computer:

 $  ps -ax  PID  TT  STAT      TIME COMMAND     1  ??  Ss     0:00.04 /sbin/init      2  ??  Ss     0:00.19 /sbin/mach_init     78  ??  Ss     0:00.18 /usr/sbin/syslogd -s -m 0    84  ??  Ss     0:02.67 kextd    86  ??  Ss     0:01.51 /usr/sbin/configd    87  ??  Ss     0:01.12 /usr/sbin/diskarbitrationd ...   358 std  Ss     0:00.03 login -pf taylor   359 std  S      0:00.04 -bash   361 std  R+     0:00.01 ps ax 

Quite a few applications, certainly many more than Force Quit suggests, are running. This is the key reason to learn and work with the Unix side of Mac OS X in addition to the attractive graphical facet of the operating system: to really know what's going on and be able to make it match what you want and need.

Here's another example. Suppose you just received a CD-ROM from a client with a few hundred files all in the main folder. You need to copy to your home directory just those files that have "-nt-" or "-dt-" as part of their filenames. Within the Finder, you'd be doomed to going through the list manually, a tedious and error-prone process. On the Unix command line, it'd be a breeze :

 $  cd /Volumes/MyCDROM  $  cp *-dt-* *-nt-* ~  

Fast, easy, and doable by any and all Mac OS X users.

There are a million reasons why it's helpful to know Unix as a Mac OS X power user , and you'll see them demonstrated time and again throughout this book. They are shown in even more detail in advanced books like Mac OS X Panther for Unix Geek s , by Brian Jepson and Ernest E. Rothman (O'Reilly).

Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net