LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Regarding coparing file attributes in different directories., (https://www.linuxquestions.org/questions/programming-9/regarding-coparing-file-attributes-in-different-directories-697596/)

sharp859 01-15-2009 04:24 PM

Regarding coparing file attributes in different directories.,
 
Hi Anybody,


I have one scenario to be tackled out.

I have some files in this directory /www/aff/cgi-bin/ and this directory
/www/cgi-bin/ and file contents are exactly same and I could get if any mismatch using diff command,but I wanted to know is there any file permission change ,groups are change etc (basically file attributes I have to compare),How I can do this? any help greatly apprciated.


Thanks,
Praveen.

gilead 01-15-2009 04:46 PM

You could use something like the following to diff the stat output for a pair of files. It would need a wrapper script to be practical for use on a large number of files though:
Code:

diff <(stat file1.log | egrep 'Access.+Uid.+Gid') <(stat file2.log | egrep 'Access.+Uid.+Gid')


All times are GMT -5. The time now is 12:52 PM.