![]() ![]() ![]() You can also go a step further and direct the output of the command to a file, it is said to have the name differences.txt:ĭiff -rq directory1 directory2 > differences.txt Only in directory2: MyFavoriteSpecialMovie.mp4 Must Read: How to Restore Delete Key Functionality in Safari 6 to Go Back a Pageĭirectory 1 only: SuperSecretDifferFile.rtf The example output of the command might look like this: We use the -rq flag because -r means that the inclusion of subdirectories is recursive and -q simplifies the output of the command only for the differences shown. This executes the diff command by comparing directories1 and directories2 (if you have a folder with a space between the files, just enclose it in quotation marks like “folder one”). To get started, start the terminal in Mac OS (found in / Applications / Utilities /) and use the following command syntax:Ĭlick return when you have specified the directories to compare. How to compare the contents of two directories diff Diff is fairly simple to use, so you can easily compare the contents of two directories, just follow the syntax described below. To achieve this comparison, we use the command line tool ‘diff’, diff is available on all Macs along with Linux and other unix operating systems, so this is practically a multi-level solution for comparing directories. This command line approach produces a file that contains the exact differences between the two destination folders. This tutorial shows you how to compare two directories and the contents of these directories using a terminal. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |