OS X Is a Treat, Now For the Tricks!
Mac OS X has now entered it s third official incarnation with the release of Mac OS 10.2 (Jaguar.) While not all the major apps have joined the party there are many new opportunities for users who have made the move. Apple has announced that new Macintoshes, shipping in January 2003, will only boot in OS X and only run Mac OS 9 and earlier applications in Classic mode. Native applications; Microsoft Office and Adobe s Photoshop, Illustrator and InDesign make Mac OS X a compelling choice.
I am telling you that this is one of the best things to happen to computing.
Hidden applications abound
When you install OS X on your Mac you also have installed a slew of UNIX applications. Apple marketing talks about iTunes, iMove and their new Mail application but they don t tell you about ls, cat, grep, to name a few of the installed UNIX apps.
When a UNIX application crashes (and they do) your OS is not tripped up. The app crashes and the Mac marches on. Ask any iMac or G4 user who is running Mac OS 9 what happens when an app crashes? Their keyboard and mouse are controlled by USB software can t can t even perform the three-finger salute. The only option – press the Reset button to get back to work.
The epitome of stability
I’ve been running OS X for the last two years and I’ve lost count of how many times my individual apps have crashed. But I can easily tell you how many times I have had to restart my Mac.
In daily life I manage twelve servers that run 24/7. All of them are UNIX servers that rarely need to be restarted. They run on Sun OS, SGI’s IRIX, Mac OS X and there’s even a Quadra 700 running Linux. All of these servers share the stability of UNIX and the utility of the applications. I should also admit to running Windows NT and 2000 servers, which need to be rebooted every couple of weeks. (Maybe Microsoft thinks Restart is an application!)
I didn’t do it because I liked it!
I became a UNIX user under duress after successfully avoided it for years.
I was bitten by the Macintosh bug in the late eighties, while working as an Art Director. I bought the Mac to enter into the world of CAD/CAM using Adobe Illustrator 88, but CAD/CAM quickly became Desktop Publishing.
You see we had QuarkXPress and needed to produce a company price list. You can probably guess the rest. But how could we get the data off our IBM 36 and into Quark. Hmmm!
Today I would start by saying, “No problem” and tell you that we could export the data to a text file and use PHP and MySQL on a Mac running OS X, and publish the data dynamically on the web! Actually, I would have said, “No problem” in the eighties but I didn’t know all this UNIX stuff back then. I have been evangelizing the Macintosh ever since. I now take great pleasure in evangelizing the new and improved Mac OS with extra added UNIX! If only QuarkXPress would run under Mac OS X! But that’s another story.
The most interesting aspect of Mac OS X is the dual nature of this marriage of operating systems. The Macintosh had always been a closed system. Users benefited from the relative ease that the Macintosh offered, but there wasn’t any way to tweak the system. Apple presented a computer that used everyday metaphors such as the desktop, folders, and trash cans to make computing easy for us average guys.
Apple has taken the mystery out of UNIX buy supporting the Aqua interface, which owes much to the Mac experience. They have even ironed out some of the stubbornness out of the UNIX command line. If you make a simple mistake the system suggests the correct command.
Try this right now!
If you re running Mac OS X go to your Applications folder, where you’ll find the Terminal among the other apps. (Drag the Terminal to the Dock, to keep it handy.) Double click the Terminal to start it up. Go ahead it won’t bite. The first thing you may notice, beside the fact that there are no menus or icons to click, is that it says (in my case)
and the curser is blinking. That s where you enter commands.
The localhost tells you that you are working on your own machine. Every UNIX machine is in fact a server or a host . You are on your local host. Next you see the username that you logged in with, and a % sign which indicates that you re a regular user.
Something else to try
Try this; type “whoami” and hit Return or Enter. Look at that! That s who you are! Even better than that you’ve just successfully run you re first UNIX application!
The next thing you need to know is where you are. Type “pwd”
and hit Return. The terminal answers back with “Users/tim”
which is to say that your present working directory (pwd) is your home directory. All users have a home and all users home directories are kept in the Users folder on Mac OS X.
To see what’s in your folder you list it. Try this: Type ls and hit Return. You’ll see all the file names listed in rows and columns across the screen. For more detail type ls -la , which means list long and all. Most command line apps options are entered usually with a hyphen, to extend the application. What you see when you do a long list is the type, permissions, links, the owner, the group, the size in bytes and that date and time the file was last modified. (We’ll cover the details in another article.)
By the way, if you want repeat a command, hit the up arrow key. The previous command will be displayed. You can use the left arrow to move to the left and edit the command.
Here’s the last trick. To create a blank text file you would type touch test.txt on the command line. Once you hit return you have created ( touched ) a new empty file in your home directory. Go ahead and type ls -la to see it. Now type echo Hello World and hit return. Echo sends the words Hello World to your screen. Hit the up arrow to bring back the last command. Add this > test.txt so that the whole command looks like
echo Hello World > test.txt and hit Return. You see nothing because the output was set into the file by the greater than >. To read the file test.txt you would type cat test.txt. Cat is short for concatenate, and it will read a file and show it on your screen. As you can see you have displayed the contents of the test.txt file to your screen: Hello World. Look at you, you just created your own file and wrote to it! (If you want to add to your file use >> instead of > . The former will append the text to the file.)
That s enough UNIX for today. Now go out and play!