Find the answer to your Linux question:
Results 1 to 2 of 2
Hello everyone I have a folder and a backup of it from earlier, and I want to compare them, as well as the individual files in them. Now, if I ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    8

    diff with files in folders/directories

    Hello everyone

    I have a folder and a backup of it from earlier, and I want to compare them, as well as the individual files in them.

    Now, if I just do
    Code:
    diff -r folder1/ folder2/
    I get a list of files that are in one and not the other.

    I want the actual difference between each and every file in each folder and itś subdirectories that are named the same in both of them. Is there a simple way to do this?

    Thanks a lot in advance!

  2. #2
    Just Joined!
    Join Date
    Sep 2008
    Posts
    8
    *Does a little bit more research*

    So, if files exist in one and not the other folder, diff will return just just those files (as stated in previous post)

    This can be overridden by using the -N flag which tells diff to treat absent files as empty. Therefore, anything in any of the files listed before will all be a difference that is output.

    Problem solved!

    diff -r -N folder1/ folder2/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...