I want to iteratively compare two directories, A and B, under Linux using:
diff -r ./A ./B
but I want to ignore some subdirectory names, e.g. a subdirectory called "svn".
How do I do it under Linux?
Click on the “Select Files or Folders” tab in the far left, to start a new comparison. Each comparison you run opens in a new tab. To start a new comparison, click on the “Select Files or Folders” tab in the far left, change the targets and click “Compare” again.
You can use diff to compare some or all of the files in two directory trees. When both file name arguments to diff are directories, it compares each file that is contained in both directories, examining file names in alphabetical order as specified by the LC_COLLATE locale category.
Click on directory comparison and move to the next interface. Select the directories you want to compare, note that you can add a third directory by checking the option “3-way Comparison”. Once you selected the directories, click on “Compare”.
cmpfiles() method in Python is used to compare files in two directories. Multiple files can be compared using this method. This method returns three lists of file names namely match, mismatch and errors.
You can write:
diff -r --exclude=svn ./A ./B
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With