Directory comparisons using diff

I’ve started to like the diff command a lot. It can help me do directory comparisons with a variety of options that I totally love. Here are a few samples that I mostly use

Compare directories and list only filenames – ignore content

# -q Report only whether the files differ, not the details of the differences
# -r When comparing directories, recursively compare any subdirectories found
diff -qr /dir1 /dir2

Ignore certain log files during comparison

diff -r /dir1 /dir2 -x *.log -x *_Mod

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s