Mac OS X,  Mac OS X Server,  Mass Deployment

Show All Files During Migration

When doing a data migration in OS X, you find that you often want to build a list of files on the source and the target media and then compare the two lists. When you do such a copy it’s important to verify that the data is all there. To find all the files on a drive, use the find command. If you’re in the working directory of the volume you’re transfering files from, the following command would show you all of the files on the volume:

find . -name "*"

To dump the contents to a file, use the > followed by the filename. So to list the contents of a volume into a file called source.txt, use:

find . -name "*" > source.txt

To do the same on the target volume, change the working directory to the target location and re-run, this time with a different name, like target.txt:

find . -name "*" > target.txt

To then compare the two, you could use diff:

diff source.txt target.txt

You could also use a third party tool to compare the files graphically. While there is a tool built into OS X for this, I like to use TextWrangler.