Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Books Media OS X Operating Systems Software Unix Book Reviews

Learning Unix for Mac OS X Panther 337

sympleko (Matthew Leingang) writes "In Neal Stephenson's manifesto In the Beginning was the Command Line , he writes about his favorite command-line utility: wc. As simple as can be, wc counts characters, words, and lines in a file. There's no GUI analogue, perhaps because anybody tempted to make one would add too many "features" that cluttered its ease of use. Think: do you know how to count the words in a Word file? BBEdit is a little easier, if you know the button to click." Read on for Leingang's review of Learning Unix for Mac OS X Panther, which seeks to reconcile the conception of user friendliness in OS X's Aqua with the sometimes-denigrated command line.
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.

This discussion has been archived. No new comments can be posted.

Learning Unix for Mac OS X Panther

Comments Filter:
  • Word Count in Word (Score:5, Insightful)

    by AKAImBatman ( 238306 ) * <akaimbatman&gmail,com> on Friday November 12, 2004 @04:11PM (#10801442) Homepage Journal
    Think: do you know how to count the words in a Word file?

    Tools -> Word Count

    Why is that so hard? It's File -> Properties -> Statistics in OpenOffice.
    • by CerebusUS ( 21051 )
      And if word count is that important to you, you can always add it to the toolbar. Then it's just a matter of hitting "Alt-C"
    • yeah pretty funny also:

      To count how many files under your home directory are named foo, you can do find ~ -type f -name "foo" | wc -l

      which is obviously a lot more intuitive than opening up File Explorer and sorting by file name... isn't it ;)
    • by dsanfte ( 443781 )
      The GUI is another obfuscation and a hinderance to people who know what they want to do, and just want it done.

      I like to view it like this:

      With a command line, you speak directly to the program, if you know the language to use.

      A GUI is going through an intermediary translator who organizes words by categories you don't recognize, obfuscating an already complicated task by playing hide-and-go-seek with nested menus.
      • by geoffspear ( 692508 ) on Friday November 12, 2004 @04:21PM (#10801559) Homepage
        The command line is an obfuscation and a hinderence to people who really know what they want to do.

        If you hook wires up to all the pins on your processor and move them really quickly between connections for the voltages corresponding to 0 and 1, you speak directly to the machine, if you know the language to use. And have really fast hands.

        A command line translates your typing into a language your computer can understand.

        • The command line is an obfuscation and a hinderence to people who really know what they want to do.

          I'd like to modify that to say "The command line is an obfuscation and a hinderence to people who only know what they want to do and not how to do it."

          The command line is extremly powerful. The GUI has it's place though. If you put someone in front of a command line with no insturction, they will have trouble getting around. There are 100+ keys on a keyboard as opposed to 2(3) buttons on a mouse. If
          • There are 100+ keys on a keyboard as opposed to 2(3) buttons on a mouse. If you do enought clicking on any desktop environment, you can figure out how to get at least somthing done.

            To be precise, part of GUI design is to be a virtual keyboard extension. All those buttons you see in toolbars are very much like if you had that button on your keyboard. (Some specialized forms of equipment, especially medical, do have such buttons.) The GUI just saves you from buying a new keyboard for every program you wan
            • That assumes that a keyboard is the "natural" way to interact with a computer.

              I don't think any GUI designers are really using "keyboard replacement" as a paradigm for their design. 30 years ago you'd probably have argued that the goal of a keyboard was to mimic what you can do with a stack of punch cards.

            • I agree completly. What I'm saying though, is that you *can* muck around and learn basics without by using a combination of the two buttons. That is much harder to do with a CLI that you know nothing about.
        • The command line is an obfuscation and a hinderence to people who really know what they want to do.

          Funny. I think that about many GUI apps.

      • With a command line, you speak directly to the program, if you know the language to use.

        But what if you don't know the language to use? That's the main advantage of a GUI over a CLI. If you don't know how to do a word count in a command line environment then you must resort to looking it up in help. If you don't know how to do a word count in a GUI then all you have to do is explore the menus to find the command. Every command is already there right in front of you.

        • by meabolex ( 788745 )
          If you don't know how to do a word count in a command line environment then you must resort to looking it up in help.

          Ohh! The agony!

          Google: word count unix: First return:

          This utility displays a count of the number of characters, words and lines in a file.

          1.14 Type the command

          $ wc temp

          This prints out a list of the number of lines, words, and characters respectively.

          The switches for this utility are
          -l print line count
          -c print character count
          -w print word count

        • This works both ways. I often check out GUI apps for doing some stuff that I would otherwise do with a command line, simply because I can't be bothered to try to find the cl utility and read its man page. Almost invariably I end up with a disillusion where I'm looking like mad through various inaptly named menu structures in the hope I find something that does what I need it to do. The problem with the menu approach is that first you don't know if the function is supported by the app, then you have to look
    • by Flexagon ( 740643 ) on Friday November 12, 2004 @04:17PM (#10801524)

      There's no GUI analogue, perhaps because anybody tempted to make one would add too many "features" that cluttered its ease of use. Think: do you know how to count the words in a Word file?

      Tools -> Word Count

      Yes, Word could be considered to be wc with too many other "features"!

    • But what if you want to do the word count of 50 files, and print the results? Using the command line, you can get this done in under 5 seconds.
    • I call shenanigans! (Score:3, Informative)

      by quandrum ( 652868 )
      It's even easier in MS Office v. X ( and we are talking about OS X, right?), it's in the freaking status bar, right next to page count and line count. I don't even have to use the mouse or the keyboard.

      This is embarrassing.
  • Linguistic origins (Score:4, Informative)

    by 2.7182 ( 819680 ) on Friday November 12, 2004 @04:11PM (#10801443)
    In an old paper by Ritchie, it is pointed out that Unix comes from the Old Dutch, Unochs, which means "tree-based".
  • by trisweb ( 690296 ) on Friday November 12, 2004 @04:11PM (#10801446) Journal
    Just the other day I was fixing a friend's mac, and while I hadn't used OSX all that much, I do use linux, so I asked him, "okay, open up a terminal" because I knew it was possible, and it was so nice to be able to use (just about) everything I could in linux. It's definately something I wish Windows had...
    • Windows does have it - look at www.cygwin.org.
      Cygwin is Unix tools for windows.
      • I use it at work. With 'X', ssh, and so on.

        It 'works' for the most part. I get issues with 'X' and things like WebSphere installers and Admin GUI clients.

        But for straight command line that is pretty seemless with Windows, I agree, it works very well.

        MS's SFU is a hunk of junk by comparison.
      • by trisweb ( 690296 ) on Friday November 12, 2004 @04:25PM (#10801612) Journal
        Oh yeah, well I know and love Cygwin, but you can't exactly go up to anyone's system and say "okay, now open up a Cygwin terminal... ... Oh, what's that, you have no idea what I'm talking about because it doesn't come with Windows and isn't attached to Internet Explorer?"

        I manage a dorm network with 44 computers, mine is the only one with cygwin installed, I guarantee it. So it's nice to go up to a Mac, open a terminal, and have it be useful.
    • An even better reason to learn the command line on your Mac is so you can SSH into it from a remote location. I use this all the time at work to download software updates and files. Right now I'm downloading NeoOffice to play with later.

      I can also administer it remotely. Handy for when my wife has some sort of problem with something, or when I have a spare minute and want to do something on my home computer.

    • It would be great if windows could ship with a functional, unix-like CLI instead of the barely usable system that ships. Until that day (which may never come), if you have to use Windows there are alternatives.

      For starters, try Cygwin [cygwin.com]. I keep this on my work Windows boxes. It's a lot to install though, so I don't recommend carrying it around on CD to put on other peoples' PCs.

      When working on other peoples' PCs, consider carrying the -tiny branch of UnitKit for Windows [twu.net] around on a USB flash drive.
  • by Anonymous Coward on Friday November 12, 2004 @04:13PM (#10801466)
    BBEdit is a little easier, if you know the button to click.


    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.

  • by YU Nicks NE Way ( 129084 ) on Friday November 12, 2004 @04:14PM (#10801483)
    Did you know that the number of words in a document is not a single value, but depends on the use of the document? I'm sure that Stephenson does know that: if you're writing for some audiences, you don't count the words in foot- or endnotes, whereas for others, you do. If you're writing for some audiences, you don't count "short words", whereas for others, you do.

    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.
    • And wc does a very poor job of counting the words in a Word document, too. Not to mention an HTML document.
      • Hi Geoff, long time no see.

        catdoc filename.doc | wc -l

        (or lynx -dump filename.html | wc -l)

        Of course you knew that. It _is_ a stupid example. Both examples here demonstrate part of the point: the strength of the command line isn't in wc, it's in being able to chain together simple commands easily to accomplish complex tasks.

        And the strength of the GUI is in making the simple tasks trivial.

        (catdoc is at http://www.45.free.net/~vitus/ice/catdoc/ ; I used to use it successfully to read Word documents I g
    • The only problem I have with using LaTeX is that there is seemingly no way to accuratly count words. I ended up with the following:

      alias texwc='dvi2tty report.dvi | sed "s/\. \.//g" | sed "s/ \. //g" | sed "s/ [A-Za-z]*-$//" | sed "s/.*_$//" | wc -w'

      Pretty nasty! The seds remove the junk that artificially inflates the word count the most, like page numbers, page headers and the table of contents. What I really need is something like:

      dvi2tty --for-screen report.dvi | wc

      where --for-screen makes dvi2tty fo
    • I think for Japanese, each sentence might count as one word, two words if it wraps onto a new line. But you certainly are correct, you can't count spaces, carraige returns, etc. as the only means of marking word boundaries. For Japanese, it is somewhat complex as you need to detect character set shifts, from kanji to katakana to hiragana to romaji and back to any of them, and not all of those character shifts necessarily mean a new word, verb endings change too. Then you'd also have to account for the
  • Mac vs Unix (Score:4, Interesting)

    by rppp01 ( 236599 ) on Friday November 12, 2004 @04:14PM (#10801487) Homepage
    I have used Unix, Linux and Windows for years. I recently switched to Mac at home.

    I find it uncomfortable for obvious reasons (new way of doing things). Yet, while I only do file movement, touches, etc via the command line in unix/linux, and I only do GUI file touches, movement, etc on Windows, I find myself using an unwieldy GUI (Finder) to do the same thing on Mac. I can fire up an xterm and do it that way, but I don't 'want' to.

    That is odd for me. Can't quite explain it. Mac is (even as a unix variant) its own creature. It leaves me feeling like I have the power of the universe in a little pretty living space.

    Maybe cause I am new to it still.
    • It leaves me feeling like I have the power of the universe in a little pretty living space.
      PHENOMENAL COSMIC POWER!... itty-bitty living space " - the Genie (Djini?), from Disney's Aladdin.
    • I agree. Finder is seriously lacking with respect to the power of explorer. Explorer is the best file manager that I have ever used (though it could be because I used it for so many years before branching out.) Finder is missing a lot of stuff that I find basic. The biggest that I can think of is the lack of a keyboard-based copy/cut/paste. I would kill for a cmd+c in finder.

      There are finder replacements out there. There was one shareware application (I can't remember the name) that had a very simil
  • Good points (Score:4, Interesting)

    by SilentChris ( 452960 ) on Friday November 12, 2004 @04:14PM (#10801491) Homepage
    I recently got an iBook (recently as in 6 months ago) after installing a G5 for a user in our art department. I'm not sure I'm a big fan of Apple's hardware or pricing schemes ($600 for an iPod that plays photos), but Mac OS X is pretty robust.

    What I especially like about their use of the Terminal is pretty much anything that can be done in the OS, can be done on the command line. Example: changing a computer's name. Think fast: how does one do this in Windows? If you started saying "command line, net with options..." you know more than most. Windows coerces you to use the GUI. Mac encourages it, but doesn't force it (at least, since they got rid of OS 9).

    Not to mention the Fink project, which adds tons of great apps to the command line. Again, I'm no Apple zealot, but their decision to have a robust command line in OS X was a great one.
    • Re:Good points (Score:5, Informative)

      by AKAImBatman ( 238306 ) * <akaimbatman&gmail,com> on Friday November 12, 2004 @04:23PM (#10801579) Homepage Journal
      Not to mention the Fink project, which adds tons of great apps to the command line.

      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!
      • Re:Good points (Score:4, Informative)

        by bsartist ( 550317 ) on Friday November 12, 2004 @04:36PM (#10801725) Homepage
        Even worse, that mess is mixed in with your current files

        Wrong. Everything Fink installs is found under /sw - *nothing* is "mixed in with your current files".
        • Seems you're right. The installer must have been showing me relative paths. *whew* At least now I can clean up that junk. :-)
        • Yeah, that's one of it's advantages. I looked at dports but fink seems a little more robust.
      • Re:Good points (Score:3, Informative)

        by justMichael ( 606509 )
        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.
        Umm, not to sound like an ass, but...

        1) Launch Terminal.app
        2) sudo rm -rf /sw
        3) Fink is nothing but a memory ;)
  • Think: do you know how to count the words in a Word file?

    Leingang doesn't?

    I mean I'm all for MacOSX and I often use the command line, but I also think clicking "Tools" and selecting "Word Count" from the drop down is more fun than typing a string of commands into a CLI.
    • Download WordService here [devon-technologies.com], And you can count the words in whatever text you're selecting (in any application), just by pressing shift-command-I, or selecting "Statistics..." from the services menu. Pretty handy.
  • by Dink Paisy ( 823325 ) on Friday November 12, 2004 @04:15PM (#10801504) Homepage
    In Microsoft Word, I go to the "Tools" menu and choose "Word Count..."

    For my current document, it reads:

    Statistics:
    Pages 23
    Words 10,234
    Characters (no spaces) 52,996
    Characters (with spaces) 63,140
    Paragraphs 107
    Lines 660

    One of the really nice things about GUI's is that they make rarely used commands (like word count) really easy to discover. You just look in the menu, and there it is. Compare that to a UNIX command prompt, where if you don't know how to write scripts and you don't know that the "wc" command is for word counts, you are lost.

    • The author of the review (and apparently the author of the book as well) are proponents of the view that each tool should be as simple as possible and do one job well. That just doesn't make sense any more. Now we have large, monolithic command line tools that can do many jobs well.

      Having one large, all-purpose tool is better because instead of having to learn many simple tools with different syntax and stringing them all together in a massive chain of fork()'s and file handles, we can use a single tool t


    • id mod you up if I could.

      people are quick to laud the CLI and bash the GUI but there are advatages to both... and the discussion is not complete without looking at all of this. I have used the command line plenty, in both Mac OS X and in other flavors of UNIX. I have never used "wc" and wouldnt have even thought to type "wc" to get a word count on a document. Word count isnt something that I have had the need for, but if I did, it would be a lot easier to discover how to do it in word (or BBEdit, which
  • by byrd77 ( 171150 ) on Friday November 12, 2004 @04:15PM (#10801505) Homepage
    grep -v -c "Something I know is not in the file" file.txt
  • I see how this works now. If you only answered with the MS way you get modded 0 but if you used the OO answer or a combination of MS and OO you get modded higher.
  • Related titles (Score:3, Interesting)

    by lpangelrob2 ( 721920 ) on Friday November 12, 2004 @04:20PM (#10801537) Journal
    Earlier this year I picked up Mac OS X Panther for UNIX Geeks [oreilly.com], since I decided I probably should know a bit more about UNIX. (Plus the foreword said, hey, even if you just update a website that has UNIX on its webserver, the book is for you.) Needless to say, that particular book hurt my head, and I think I probably should have picked up Learning Unix for Mac OS X Panther instead. Whoops.

    As I am considering the advanced Unix users that browse this forum, I'd suggest having a look at that book too/instead.

  • Typical OS bigotry (Score:2, Insightful)

    by Anonymous Coward
    Do I know how to count characters in a word document? Certainly. And, best of all, it will actually count characters, in any character set, not just in ASCII or other similar 7/8 bit sets.

    But that's not really the point. Knowing how to do something in one OS does not make the one you are ignorant about an inferior OS. If you truly do know both OSes, then I'll listen to your opinions. Until then, I'd stay away from making comparisons.

    It is the height of arrogance to assume that if you don't know somet
  • by stratjakt ( 596332 ) on Friday November 12, 2004 @04:27PM (#10801631) Journal
    A robust programmable command line is a great tool, but for completely different reasons than listed.

    It's powerful because you can create intelligent scripts to automate tasks. Then you launch those scripts by clicking them.

    You aren't going to win anyone over by typing in some esoteric "find ~ blah | fart pipe * & (! exemo!'" command, when you could have just opened the search box and typed "foo". You're just going to look like an elitest dick.

    Once upon a time, I knew all those stupid commands and switches and would pipe output through 98 different little apps to find something out.

    Now I'm happy as a clam to spend my time and energy doing other things with my computer.

    This summary, at least, is all about "using a command line to make simple tasks harder so that you can feel like a real 1337 h4z0r everytime you do something so mundane as count the words in a file"
  • by DogDude ( 805747 )
    Textpad: View, Properties

    I still contend that Textpad is the best text editor that I've ever seen.
  • I'm a CLI guy. I use a browser, but I feel bad about it :-).

    I've been looking for a simple X application that was a pipe interrupter, sort of a GUI 'cat', call it 'xcat'. The idea is to type a command like:
    xcat foo.c | wc -l
    and xcat would fill its buffer with foo.c, pop up to let you modify the buffer, and send the results to 'wc -l'.

    There are a lot of times when I want to gather text from a variety of places (including GUI places) and run it through a command line filter. An 'xcat' would help unif
    • The easiest way to program for the GUI from the command line is using Tcl.

      #!/bin/sh
      #\
      exec wish "$0" ${1+"$@"}

      pack [
      button .x -text "Finished" -command {
      puts [.t get 0.0 end]
      destroy .
      }
      ] -side bottom -anchor w
      pack [
      scrollbar .y -command ".t yview" -orient v
      ] -side right -fill y
      pack [
      text .t -yscroll ".y set" -setgrid 1 -width 60
      ] -side left -fill both -expand 1
      set fp stdin
      if [llength $argv] {
      set file [lindex $argv 0]
      if [catch {set fp [open [lindex $argv 0] r]} err] {
      puts stderr $err

  • I am wiser now. (Score:3, Informative)

    by kahei ( 466208 ) on Friday November 12, 2004 @04:30PM (#10801668) Homepage
    The fact that Neal Stephenson, the commentator, and the person who accepted the article were able to write and read so much about the subject without ever noticing all the obvious and commonly used GUI counterparts to wc -- many of which are considerably more interesting, for instance Word does a little morphological analysis to count Japanese words -- says something desperately sad about those people and perhaps about the culture they are from.

    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.

    • the obvious and commonly used GUI counterparts to wc -- many of which are considerably more interesting

      Can you use them to count the words added to a file every five minutes, to count the words ONLY on the lines beginning with "IMPORTANT", to count the number of words past the 40th character on long lines, to count the number of words in the ID3 titles in your iTunes Music folder, ...

      the finest and most satisfying way to count words (if wc's answer is good enough) is to use wc... from vim.

      Heretic. Luc
  • by yagu ( 721525 ) * <yayagu&gmail,com> on Friday November 12, 2004 @04:30PM (#10801674) Journal

    Already I'm seeing in the posts exactly what and why CLI users throw up their hands trying to deal with GUI.... and "wc" is a pretty good example. When the OP asked Think: do you know how to count the words in a Word file?, I knew without even reading on in the posts I was going to encounter (and, I did):

    • at least two versions/ways to do wc in a word doc within the first 10 posts, and....
    • a real attitude from the anointed who had the "answer".

    For those who didn't bother to sign up for the clue, the question was mostly rhetorical, and was an example of the diff between CLI and GUI. I know my immediate response wasn't, "I know EXACTLY how to do that in word," but rather, "Hmmmmm, I know I've solved that and found that "option" SOMEWHERE in word before, but I don't remember exactly where..."

    OTOH, were you to ask CLI users the same question.... they would all know exactly how to use wc, and interestingly enough, had you asked the same question to the CLI users over the past fifteen years you would have gotten the same answers. So, in addition to a simple answer, CLI is a consistent one.

    P.S.And don't even get me started about the menus with chevrons! Assuming for the sake of argument we are talking about the current version of WORD, have YOU ever tried to walk someone through this kind of stuff over the phone? With MS' genius implementation of self-modifying menus, you could "claim" something is in a menu when trying to help someone when in fact because of their use menus, their menu is completely different from yours.

    • And don't even get me started about the menus with chevrons! Assuming for the sake of argument we are talking about the current version of WORD, have YOU ever tried to walk someone through this kind of stuff over the phone? With MS' genius implementation of self-modifying menus, you could "claim" something is in a menu when trying to help someone when in fact because of their use menus, their menu is completely different from yours.

      Without knowing where it was beforehand it took me about 5 seconds to find

      • Yes, you found it.... I've found it, many times! But why would we even have to go through this hoop in the first place? The crowning achievements I'm seeing in posters is, "I found it!", which misses the point. In WORD, and most other MS products, learning how, when, where, and why typically isn't sufficient to "know" the interface -- they're always changing it -- and we're always having to re-learn it. I can do that, I can deal with it, but why should I have to?

        Learn it once, that should be all you ha

      • This may be Microsoft's biggest HCI flaw ever. The second one is whatever caused our lead Filemaker developer to accidentally and irretrievably delete an entire project in Access 97 a mere two hours into a product evaluation.. But number one is a threefer: making interface elements moving targets, hiding a large portion of the menu items from view, and adding an extra click to access the hidden items.

        The unspoken prime directive of interface design is No Moving Targets. It makes the UI harder to learn, slo
    • OTOH, were you to ask CLI users the same question.... they would all know exactly how to use wc, and interestingly enough, had you asked the same question to the CLI users over the past fifteen years you would have gotten the same answers. So, in addition to a simple answer, CLI is a consistent one.

      OTOH, the CLI answer *could* just as easily be anything, and it can be pretty hard to find if you don't know. I could make an wordcount tool be called "wrdcnt" or "wordcount". Given only the executable name 'wc

  • by benwaggoner ( 513209 ) <ben.waggoner@NOspam.microsoft.com> on Friday November 12, 2004 @04:39PM (#10801755) Homepage
    Guys,

    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.
  • Rant time (Score:5, Insightful)

    by edremy ( 36408 ) on Friday November 12, 2004 @04:47PM (#10801844) Journal
    Word count. What a moronic example. Let's imagine I'm a typical Word user vs. a typical Unix user

    Word: I don't know how to word count. I can either trawl the menus (Hmm, "Tools" looks possible- gee, option 4 is Word Count- maybe that works) or click Help and type word count and get the #1 option: How to count words. Farking trivial for poo-flinging chimp, perhaps less so for a typical user but having worked help desk, I've never gotten a call about this. I get a nice list of pages, words, characters, paragraphs, etc.

    Unix. Well, gurus know wc. If not, how do I find out about it? Perhaps I actually know the "man -k" command. Let's try "man -k word count"- hmm, ~8 pages scroll by. I'm a really smart unix user: "man -k word count |more". Let's look at the entries

    #1- BN_add_word (3ssl) - arithmetic functions on BIGNUMS with integers. Hmm- fuck no. (Omitting much BN badness)

    #8- EVP_BytesToKey (3ssl) - password based encryption routine. What the hell? I just want to count words, damnit.

    4 screens later, I actually find wc- maybe that will work.
    "wc myfile.txt". (And it had better be ASCII text- don't try feeding wc a file in Japanese. Or an HTML file for that matter: Word correctly counts the actual text without the tags, wc won't) "1624 2282 53168 myfile.txt" Ok, which number do I care about? "man wc" Hmm- probably the second. But hey- it's scriptable. That means it's better, right?

    Witness the amazing power of the command line: I can dick around for five minutes trying to figure out what command to use and end up with one vastly inferior for almost all tasks compared to the GUI version.

    I love command lines, I really do. (I have to- I admin a couple of Unix boxes) But people vastly underestimate how powerful GUI tools have gotten and how long it takes to learn the arcane syntax of a typical Unix shell.

  • by Angst Badger ( 8636 ) on Friday November 12, 2004 @05:00PM (#10801965)
    I've been gleefully using the word counts in MS Word since the early 90's. There are actually two places you can get at them, and they're both readily accessible.

    Speaking of the early 90's, this reminds me of a conversation I had on a TeX mailing list around 1994. I was thrilled with the idea behind TeX and struggling with the implementation. In the course of getting some answers about the surprisingly difficult process of setting up columns of varying widths, I overheard a conversation in which some TeX zealot was meandering on about all the things Word couldn't do. The problem was that all of the things he was talking about were things Word could do. He simply never got familiar enough with the application to actually use it well.

    Word has its problems, it is true. It has a number of bugs that may or may not be a problem, depending on which features you use. Recent versions have become lumbering resource hogs without adding much new functionality. It lacks some expert layout features that would enable it to fully close the gap with real document layout software, though it's good enough 90% of the time. It's owned by Microsoft. It is, however, probably the most comprehensive and full-featured word processor out there. OpenOffice.org is getting very close, owing more to stagnant development at Microsoft than anything else, and may overtake it soon. I've started using it for complex documents and, most of the time, I don't miss Word.

    You see the reverse with GIMP advocates. The claim that GIMP is as good as Photoshop can only be made by people who don't know Photoshop very well and whose graphic output is mostly limited to web pages. GIMP isn't even close to Photoshop, and as opposed to the situation with Word and Microsoft, Adobe lavishes so much developer resources on Photoshop that the gap is actually growing.

    To return to the original topic, yes, wc is a handy utility. But it is really much more useful for data manipulation by programmers and other IT professionals than for anything else. And if you want to enlighten people about the virtues of commandline tools -- and they are indeed legion -- it helps if you don't immediately discredit yourself by discussing applications that you understand only very superficially.
  • Has the "unix" in Panther changed any since the "unix" in the last incremental iteration?

    Furthermore, iirc, OSX is still not technically capable of holding the "UNIX" badge from The Open Group.

    Whether that's a good thing or a bad thing is up for debate.

    Now, as far as having some tcsh commandline skills on OSX, that would surely be useful for some every-day puttering around on the desktop.

    But most anyone I know (primarily solaris, Linux, Freebsd and Obsd guys) who ran out and bought a powerbook or such f
  • wc counts words??? (Score:4, Insightful)

    by sootman ( 158191 ) on Friday November 12, 2004 @05:28PM (#10802215) Homepage Journal
    I always use it to find how many files are in a directory (ls -R | wc -l) or how many Windows boxes are trying to root me (cat /var/log/httpd/access_log | grep cmd.exe | wc -l) or how many visitors I got from a Slashdot story (cat access_log| grep slashdot | wc -l) or how many files I've touched this year (ls -lR | grep 2004| wc -l) or...

    What I'm saying is, people who complain about the "how many ways do you know to count words?" example are missing the forest for the trees. 'wc' is one of countless small UNIX utilities that I sting together in new combinations ever every day. I don't write books or magazines, so I *never* care how long my files are in that sense. But seeing how many lines in a log file contain a certain string is useful every day.

    Besides, "In the Beginning..." was written back in 1998 or 1999.

    Beyond WC: The coolest things about unix in OS X is the interaction with the GUI. I can type "scp " and then drag a file from the desktop into the Terminal window and then finish with the destination server and path. I can be anywhere in the filesystem and say "open ." and a Finder window of the current directory will open. I can access the clipboard with "pbcopy" and "pbpaste" (though I must occasionally make a temp file and use 'tr' to change from Mac line breaks to unix line breaks). The final hurdle--dealing with two-part Mac files at the command line--will be solved in 10.4.
  • by Jamie Zawinski ( 775 ) <jwz@jwz.org> on Friday November 12, 2004 @06:01PM (#10802544) Homepage
    ...since the first thing one learns about OSX is that it makes traditional "find" incantations completely malfunction due to filenames with spaces in them: you have to re-train your finger memory from

    find . -type f | xargs foo
    to
    find . -type f -print0 | xargs -0 foo

    For a good laugh, try explaining why that is necessary to a Unix newbie!

  • by datasetgo ( 751392 ) on Friday November 12, 2004 @06:25PM (#10802790)
    heheh - just look how many of you just openly admitted to having Word installed on your machines. Jesus! And you call yourselves slashdotters...

    [it's a joke son, move along]

Your program is sick! Shoot it and put it out of its memory.

Working...