Compare The Contents Of Two Folders With The Diff Command

Compare The Contents Of Two Folders With The Diff Command

Mac: Whether you want to sort out duplicates or figure out which folder has certain files and which doesn’t, you can use the diff command in the Terminal to find out fast.

The diff command is traditionally used to look at the difference between text files like this:

file-1 file-2

You can also compare the contents of two folders by adding -rq:

diff -rq folder-1 folder-2

Once you enter this command — changing folder-1 and folder-2 to the folders you want to compare– the terminal will spit out a list of differences between them. That’s all there is to it! Hit the link below for more on the process. (Similar functionality is available for Linux users.)

Compare two folders’ contents in Terminal [MacWorld]


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


One response to “Compare The Contents Of Two Folders With The Diff Command”