Thursday, December 19, 2013

Compare the Contents of Two Folders with the Diff Command

Compare the Contents of Two Folders with the Diff Command

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.

While traditionally used to look at the difference between text files like this...

diff file-1 file-2...you can also compare the contents of two folders by adding -rq:

diff -rq folder-1 folder-2Once you enter this command—changing folder-1 and folder-2 to the folders you want to compare, of course—the terminal will spit out a list of differences between them. That's all there is to it!

Compare two folders' contents in Terminal | MacWorld


View the original article here

No comments:

Post a Comment