Learning Unix for Mac OS X Panther 337
Learning Unix for Mac OS X Panther | |
author | Dave Taylor and Brian Jepson |
pages | 168 |
publisher | O'Reilly |
rating | 8/10 |
reviewer | Matthew Leingang |
ISBN | 0596006179 |
summary | Nice and Easy |
You can do a tremendous amount of stuff in Mac OS X Panther without ever touching the command line. This includes editing files, transferring them to remote locations, running a web server, and writing programs. Legend has it that some Apple developers wanted to ship OS X without a command-line application because it's anathema to the Mac "experience." But as Unix geeks will tell you, there are tasks which are much better suited to the command line. Routine, repeated, and automated tasks are some, as well as quick-and-easy access to files and directories.
This book is for the skilled Mac user who would like to know a little more about the operating system behind the scenes. There's also information about the Mac's brand of Unix, so someone familiar with Unix but new to the Mac will also find stuff to learn. For those confident in their Mac and Unix skills, however, there's not much new in the book's 168 pages. That's not to say it's a bad book; I found it quite enjoyable to read, and it's a good title to keep in mind to recommend to a Unix novice.
The book begins with an introduction to Terminal.app, the Mac's Unix terminal program. From the very basic (how to find with the Finder) to the fun (how to change the text and background colors) to the useful (how to save terminal sessions into double-clickable .term files), there's much that Terminal has to offer. There's even the cryptic echo '^[]2;My-Window-Title^G' command to change the title of Terminal's window.
The authors then introduce a few simple commands like date and who, and show how to manipulate the terminal's prompt. There's also alias which creates command shortcuts. For instance, if you always run ls with the -F flag, a command alias ls "ls -F" will save you some typing.
Each chapter has two sections which stand out. The "Practice" section gives a list of exercises to try, and the "Problem Checklist" is there to diagnose and fix unexpected behavior.
It's important (especially for those used to other OSes) to understand that in Unix, everything is a file, and all files are organized in the filesystem. This includes plain files, which might be Word documents or system logs; directories, which break up the filesystem into a tree; links, which allow file reuse with different names; devices, drives, etc. All these building blocks of the operating system are discussed. There are also a few pages on vi (which I found quite useful as my vi knowledge up to that point consisted of :q!.) and pico.
Printing on Mac OS X is much like printing on any Unix operating system; you can use pr to format text for line printing, enscript to format for PostScript printing, and lpr to actually queue a printer job. The addition that the Mac provides is a CLI to AppleTalk printers. You can use at_cho_prn to choose an AppleTalk printer and atprint to print to one.
One of Unix's biggest features is its ability to put together small programs to do many different tasks. To count how many files under your home directory are named foo, you can do find ~ -type f -name "foo" | wc -l. By breaking down a problem into components, you only need one-counting program, one file-finding program, etc. The book has a good chapter on this input/output redirection, and how to use those magic top-row characters |, >, >>, and <. Grep (and some light regular expressions) and sort are mentioned as tools for examining text. I thought sed would make a nice addition to this chapter, but perhaps it would lengthen the book too much.
Another advantage of Unix is its true multitasking. What may surprise newcomers to the command-line is that it is possible to run many jobs at once with a single interface. By running commands in the background, one can start large jobs and do other tasks while waiting. In the chapter on multitasking, the & modifier is covered, along with fg, bg, and kill to manipulate processes, and ps and top to report on them.
The command-line interface is lightweight enough that it can easily be extended by a network. This means it's easy (in fact, commonplace) to control a computer different from the one in front of which you're sitting. The authors cover the remote-shell commands ssh and its non-secure cousins, as well as other tools for accessing the internet such as ftp and curl.
The book closes with an introduction to the wealth of open-source software available for Macintosh, now that Macs run a functional Unix. The graphical Unix applications require an X server, which is easy to download and install. The authors show how to install Fink, the Macintosh open-source package manager, and a few big applications like OpenOffice.org and The Gimp.
The last chapter is both a resource list and suggestions for further directions. Those who learn a lot from this book may be interested in picking up shell programming or a scripting language such as Perl.
As I said at the beginning, the book is basic and well-written. Even if you feel it's beneath you, keep the title in mind when a newbie asks what the command-line is all about.
Matthew Leingang is a Preceptor in Mathematics at Harvard University. A funny sentence in the third person escapes him at the moment. You can purchase Learning Unix for Mac OS X Panther from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Linguistic origins (Score:4, Informative)
Count words in BBEdit (Score:3, Informative)
Yea, the big freaking button with "i" in a circle right in the middle of toobar. It will tell you characters, words, lines and pages. Even easier and faster to use than wc.
Re:Word Count in Word (Score:3, Informative)
Do you know how to count words at all? (Score:5, Informative)
And, of course, if you're writing in Japanese, wc counts your entire document as being one word long.
What does this have to do with Unix? It's a classic example of Einstein's dictum that everything should be made as simple as possible, but no simpler. The Unix command wc is a classic exmple.
Re:Linguistic origins (Score:3, Informative)
Re:Good points (Score:5, Informative)
Fink is nice, but it tends to make something of a mess. Even worse, that mess is mixed in with your current files, making it difficult to clean up later. I've found that http://packages.opendarwin.org [opendarwin.org] works better. Don't access it through your web browser. just select finder, then click on the "Go" menu, then "Connect to Server...". Place that URL in the textfield and click "OK". You should now have a WebDAV archive of opensource binaries mounted on your desktop.
Have fun!
I am wiser now. (Score:3, Informative)
But the fact that so many slashdotters stepped up already and cared enough about nitpicking the record straight that they have posted the path to the word count tool in Word at least half a dozen times already, fills me with hope!
I feel as if I have gained wisdom from this simultaneous despair and revival. The feeling is probably false, though.
Incidentally, the finest and most satisfying way to count words (if wc's answer is good enough) is to use wc... from vim.
Re:Good points (Score:4, Informative)
Wrong. Everything Fink installs is found under
Re:Word Count in Word (Score:5, Informative)
Easy peasy.
Word 2004 ALWAYS shows word count (Score:4, Informative)
The default install of Word 2004 for Mac always shows the word count, in the lower right hand corner. It shows it as XXX/YYY, where XXX is how many words are before the cursor, and YYY is for the entire document.
As a professional writer, I can't imagine what wc would offer me that would be better than that! I often work on very specific total word targets for articles, so I can track if I'm under or (much more likely) over, and tweak accordingly.
Personally, I haven't been able to use Word on Windows since they started putting the icons in the wrong place in the menus. The PowerBook 17" is the ideal writing machine today, in my opinion.
Re:how many ways to do wc in a gui (word) (Score:3, Informative)
Without knowing where it was beforehand it took me about 5 seconds to find the following:
Right click on any Toolbar, Customize, Options, and check "Always show full menus."
Re:Good points (Score:3, Informative)
1) Launch Terminal.app
2) sudo rm -rf
3) Fink is nothing but a memory
Re:Word Count in Word (Score:3, Informative)
I call shenanigans! (Score:3, Informative)
This is embarrassing.
Re:Word Count in Word (Score:2, Informative)
Ohh! The agony!
Google: word count unix: First return:
Re:Word Count in Word (Score:3, Informative)
It's been described as "like grep if it was bitten by a radioactive spider". In a nutshell it allows you do define sliding windows and search for phrases inside those windows.
It's way cool.
Re:Word Count in Word (Score:1, Informative)
I'm a 'desktop guy' but I first dicovered computers through TeX in 1980, and keep a Terminal window open half the time. I too bounce back and forth.
Then there's Quicksilver [blacktree.com] on OS X, with its hybridity; keyboard control full of CLI hooks, anticipatory bold-and-fast GUI feedback, and it's now being extended well past a search/launch core function. It's both GUI and CLI and neither.
I'm using it more and more on its own. File name completion good iconic feedback really makes things feel instantaneous.
I enjoy the tired old desktop, but I'm hoping something like Quicksilver will replace it.
People seem to be missing a point about wc (Score:1, Informative)
This, for e.g., comes in useful when you need to count the total no. of lines of source code in a project (with multiple files in subdirs).