How can I compare file structures before and after a software install?

In Terminal I can think of two choice:

  1. ls -R.

  2. tree directory-name/ (after you install it; i.e. brew install tree). The slash at the end preserves the display of special characters in the file the output is saved to.

In both case you redirect the output to a file before and after installation and compare the two files possibly using Apple FileMerge.app shipped with Xcode.


I like using "find" and "shasum" for this sort of task. Two different invocations, 1 for the structure, and another for the sha-1's of the files:

find -s /path/to/directory -ls > files-before.txt
find -s /path/to/directory -type f -exec shasum \{} \+ >> files-before.txt

Run your installs/uninstalls, and then use the same process to "files-after.txt". Then

diff files-before.txt files-after.txt