Diff without details – show only file names

If you’re interested only in finding out the files that may have changed and not necessarily the content, you could use diff with -q to return only filenames

diff -qr dirStage dirProd

It gets even better. If you’re comparing stage and prod environments, you’re likely to have log, pyc, db backups and other files that you don’t care about. Here’s how you can ignore unwanted file types using the -x argument:

diff -qr -x '*.pyc' -x '*.log' -x '*.sql' -x '*.txt' dirStage dirProd

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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