Track down installation details
Ever wonder exactly what gets installed when you run one of Apple’s Software Updates? By using Terminal, you can usually find out exactly what an installer added to your system. This can be useful if you have trouble with an update, or if you’d like to remove a program that doesn’t include an uninstaller.
OS X keeps track of installation details in the /Library/Receipts folder. Open Terminal (/Applications/Utilities) and type the command
ls -al /Library/Receiptsto see this folder’s contents. A long list of receipt files (one for every program you’ve installed on your Mac) will greet you. These files are actually folders; within each one is a document that lists every file changed by that program’s installer.
Take, for example, the listing Safari.pkg. To see what files Safari’s installer changes, type these commands into Terminal (ignoring the
$, which stands for the Terminal prompt):
$ cd /Library/Receipts $ cd Safari.pkg/Contents $ ls -al
These commands switch into the Receipts directory, navigate into the Contents folder within the Safari package, and then list the files within that folder.
It’s the Bom! To see a list of every file that changed when you installed a program, use the lsbom command.
You’re interested in the file Archive.bom ( bom stands for “bill of materials”). It contains an inventory of every file the installer touched. Using the Unix command
lsbom(which lists the contents of a .bom file), you can get a list of the changed files by typing
lsbom Archive.bom -pf | more.
lsbomto show only file names; otherwise, you get a lot of excess information. Type this command and press return to see output fill your Terminal window (see “It’s the Bom!”). The list of files is huge—more than 2,900 entries. To stop the output, just press Q while it’s paused at the bottom of a screen. You may find the
lsbomcommand most useful when you’re investigating the impact of small programs that use Apple’s installer.
As with Safari, you’ll find most .bom files in the Contents folder within the application’s package. Most will also be named Archive.bom. But there are exceptions: for instance, DVD Player Update’s .bom file is called DVDPlayerUpdate.bom and lives in the update’s /Contents/Resources folder. If you can’t find the .bom file you’re looking for, change directories (using the
cdcommand) into the application’s package, and then type this command:
find . -name "*.bom"
This will locate any .bom files at or below the currently active directory and display the path and file name for any matches it finds.
OS Xs secret Services
You’ll find Mac OS X’s Services menu in every single Mac application, under application name: Services. But if you’re like most users, you probably haven’t given it a second glance. That’s a shame, because services let you access the powers of other applications while staying right where you are—in other words, they’re big time-savers.
From this menu you can, for example, quickly create a Font Book collection of the fonts that appear in a selection of text in a TextEdit document. But that’s not all—with one menu selection, you can also send the text via Mail, make a Stickies note containing the text, or run a Spotlight search on the text (see screenshot). Some services have keyboard shortcuts—Command-shift-L, for instance, will search Google using the selected text as the search term.
Select a Service OS X’s Services menu offers many useful goodies.
Savvy Application Required Even though you’ll find the Services menu in every program, its items aren’t active in all of them. Services work automatically in some, but not all, applications. For instance, they’ll work in all major Apple apps, since they’re developed using something called the Cocoa programming environment. Third-party developers, however, may not use Cocoa, and must explicitly add support for services. So you’ll find that services work in BBEdit but not in Microsoft Word or Excel. The only way to know for certain is to try them.
What if you know the program you’re in supports services, but all the menu items still appear grayed out? Remember that you must first select something—a file, a folder, or a chunk of text—to use a service.
An Ever Expanding Menu Your brand-new OS X machine may have only 15 or so services on offer, but expect this number to increase over time as applications add services. My Mac lists 73 top-level entries.
Many programs add useful systemwide services. Stairways Software’s Interarchy, for instance, adds an Upload File option that makes quick work of sending files to a Web server. But the Services menu can become so large that it’s difficult to use. Apple doesn’t provide an easy way to remove unneeded Services items, but you can do it yourself.