Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are many methods that can be used to compare the data of two files. That is not what I'm interested in here.

How can I easily compare or "perform a diff" of what could be called (perhaps you can also help figure out what to call this stuff) the "file-system/OS" properties/attributes of two files?

For example:

-Timestamps (created/last modified/last accessed)
-Properties such as "Read Only" or "Hidden" "Executable"
-Any others not listed here that you know of

While I imagine there are different answers for each of them, can such a thing be done (without too much pain) in the following environments:

Windows 7     (assuming NTFS - does this matter?)
Ubuntu Linux  (assuming ext4 - does this matter?)
OSX           (assuming HFS+ - does this matter?)

If an answer contains a response relevant to only one of these environments I will still value it.

share|improve this question
stat (*nix/os x) and dir/attrib/icacls (windows) are most likely what you're after. The details about the files you're looking for are called metadata. – MaQleod Mar 19 '14 at 7:24
up vote 2 down vote accepted

On linux/osx you can do the following

% stat foo > /tmp/foo.stat && stat bar > /tmp/bar.stat && diff /tmp/bar.stat /tmp/foo.stat

Should be pretty easy to wrap the above in a shell script. There are likely ways to do this without using the tmp files.

share|improve this answer

On *nix systems to compare info about foo and bar you can just:

diff <(stat foo) <(stat bar)

you can of course get more info with other commands:

diff <(ls -l foo ; stat foo) <(ls -l bar ; stat bar)
share|improve this answer
This is a better answer than mine. Use it instead. – skarface Apr 8 at 19:19

I hope this is what you are looking for.. Its a 3rd party tool...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .