Unix Shell - Identifying if object {filename|directoryname} is file or directory when using diff -s

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2006 > Identifying if object {filename|directoryname} is file or directory when using diff -s





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Identifying if object {filename|directoryname} is file or directory when using diff -s
Dundonald

2006-10-19, 1:21 pm

Thanks to Jon in response to my post Comparing Directory Structures I
have managed to tidy up my own solution by using

diff -sqdr <directory1> <directory2>

which returns with lines to the effect of

Only in {d1|d2}: {filename|directoryname}

Files d1/{filename|directoryname} and d2/{filename|directoryname}
{differ|are identical}

I do a grep -v "are identical" so I only receive the differences back.
But what I'm keep to find out is if it's possible that the diff command
can tell me if in the same return if the object that is different is a
file or a directory.

Thanks

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com