Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6959061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:13:20+00:00 2026-05-27T15:13:20+00:00

I have two folders which I want to open with the same application. To

  • 0

I have two folders which I want to open with the same application. To me, both folders seem identical, but to the application, they don’t.

First, I used this command to find any differences in the contents of the folders:

find folder/ -type f -name * -exec md5 {} + | awk '{print $1}' | sort | md5

This command yields the same result for both folders. But then, I tried this command:

tar c folder/ | md5

This command yields different output for both folders. The command also takes longer to complete for one folder than for the other.

I’m using Mac OS X Snow Leopard. What is going on here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:13:21+00:00Added an answer on May 27, 2026 at 3:13 pm

    tar c includes the folder name in it’s compression, so unless the folders have the same exact name that will cause a mismatch.


    Also remember that tar will try to recover the permissions used on files compressed, that might also cause a mismatch if the folders don’t have the same exact permissions, as well as ownership.

    To see if permissions/ownership is the same for the two folders use something as the below, piped to sort | md5 or whatever.

    find foobar -exec stat -f "%p:%N:%u:%g" {} \;
    

    The above will have the folder name "foobar" in the output, you should strip that out, you could use something like this:

    find foobar -type f -exec stat -f "%N:%p:%u:%g" {} \; | sed 's/^foobar//'
    

    My recommendation

    If you just want to see if the contents of files and their corresponding file name matches, use the diff utility instead of your own custom written version, as below:

    diff -r folder1 folder2
    

    Documentation of diff

    • manpages(5) Mac OS X Developer Tools Manual Page – diff
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to compare two folders on Windows (Vista, XP) which have a large
I have a CI website which contains two application folders, one for the front
I have two folders, for arguments sake /Volumes/A and /Volumes/B. They are mounted network
I have two folders php and perl . They contain index.php and index.pl ,
I have wrote an application that syncs two folders together. The problem with the
I have used two GUIDs to open the folders My Computer and My Documents
I have two applications under tomcat/webapps folder. tomcat/webapps/App1 tomcat/webapps/App2 Both applications share the same
I have a List which has a two level hierarchy of folders. Something like
I want to do a simple versioning system but i don't have ideas on
I have a bunch of source control folders for which I want to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.