diff terminal command

I want to compare two folders using the diff command in Terminal.


One is on an external drive called “Seagate_181110_8TB_Drive”, and the folder is called “verified_saved_on_190109_HDD”.


The other is on a different external drive called “190109_HDD⁩” and the folder is called “verified_from_Seagate_181110_8TB_Drive”.


What is the correct syntax for that command?

Posted on Feb 9, 2019 8:41 AM

Reply
7 replies

Feb 9, 2019 10:02 AM in response to Mr. Spock

The -w flag can be handy for plain text files because it tells diff to ignore white space when comparing files. And of course you can use a full path to the files to compare.



diff (file input 1) (file input 2)



You can see more from the terminal, copy and paste:

man diff | more


Using the -rq flag because -r means it is recursive to include subdirectories, and -q simplifies the command output to only the differences shown.

Feb 9, 2019 10:07 AM in response to leroydouglas

Hi leroydouglas,


Thank you for that. I have tried that but no joy.


$ diff verified_saved_on_190109_HDD verified_from_Seagate_181110_8TB_Drive


diff: verified_saved_on_190109_HDD: No such file or directory


diff: verified_from_Seagate_181110_8TB_Drive: No such file or directory


I think it is because they are on external volumes. How do I set the command for the different volumes?

Feb 9, 2019 10:24 AM in response to leroydouglas

OK, no errors so far and the folders are 1.3 TB each (give or take a few MB) so this will take some time I am sure. I'll report back if it fails. So far, I am thinking no news is good news.


I entered this: diff -rq /Volumes/190109_HDD/181110_8TB_Drive_contents_2/verified_from_Seagate_181110_8TB_Drive /Volumes/Seagate_181110_8TB_Drive/verified_saved_on_190109_HDD


and got this (so far): Only in /Volumes/190109_HDD/181110_8TB_Drive_contents_2/verified_from_Seagate_181110_8TB_Drive: .DS_Store

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

diff terminal command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.