Software for Apple’s OS X platform comes in package files, and these packages make installing software extremely simple. This was one of the advances that came with the Unix-core OS X is based on. Users should always check to make sure that they know what’s in a package they’ve downloaded before installing it. Generally this can be done with the Mac Finder.
Mac Finder isn’t always capable of reading the contents of a package file, which requires users to rely instead on the command line to view what’s inside. Additionally packages can sometimes become corrupt or you might need to extract a single file from a package for some other reason. The same command can be used to accomplish this.
Viewing Package Contents
Open the Mac Finder from the dock, navigate to /Applications/Utilities/ and then launch the Terminal.
Use the following command pointed at the package you want to view the contents of:
pkgutil –expand thePackage.pkg /destination
Replace thePackage.pkg with the package name and /destination with where you put it. For instance, if you wanted to work on the Desktop with a package called volume.pkg:
pkgutil –expand volume.pkg ~/Desktop
These files can now be examined, manipulated or thrown in the Trash once you’re done with them. If you wanted to keep only .gif files from a package, for example, you could make a directory then move them to it before deleting all of the others:
mv *.gif ./Images