O'Reilly logo

Mac OS X: The Missing Manual, Panther Edition by David Pogue

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting It Together

All of the Unix syntax and vocabulary presented in this chapter and Chapter 15 is all well and good, and it will give you the rosy glow of having mastered something new. But it still doesn’t entirely explain why Unix gives programmers sweaty palms and dilated pupils.

The real power of Unix comes farther down the road—when you start stringing these commands together.

Suppose, for example, you want to round up all the TIFF image files related to your Yosemite project, scale them to a common size, convert them to JPEG files, and copy them to an FTP site. How would you go about it?

You could, of course, use the Finder’s Find command to search for all TIFF files that have “Yosemite” in their names. But what if your images were named otherwise but kept in folders with Yosemite in their names? You would have to find those folders first, and then the TIFF files within them.

You could perform the next step (scaling and converting the image) either manually or by a preprogrammed script, using a program like Photoshop or even iPhoto. Once the images were all done, you’d need to collect them and then use your favorite FTP program to upload them to the server.

But with a mastery of Unix, you could shave 12 minutes off of your workday just by changing to an empty working directory and typing this as one long line:

		find ~ -type f -ipath '*yosemite*tif' -print0 | xargs -0 sips -Z
250 -s format jpeg—out . ; ftp -u ftp://ftp.coast-photo.com/Incoming *

Even after two chapters of Unix ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required