[CVALE] Comapring a directory tree on Linux...

Patrick Bennett stnick at bennettbungalow.com
Tue Nov 28 20:07:59 PST 2006


Landon Blake wrote:
> Specifically, I want to determine which folders and files exist in the 
> directory structure for the source code of the fork, but not in the 
> original.
Are we not making this overly complicated???  Wouldn't the simple way to 
do exactly this be something like:

ls -R /dir/original > /tmp/original.dir &
ls -R /dir/fork > /tmp/fork.dir &
diff /tmp/original.dir /tmp/fork.dir

??!?  I don't think we need python for this boys and girls.  (But, of 
course, timtowtdi.)  It could probably even be done with pipes and 
whatnot without ever creating a tmp file, but I'm too lazy to figure it 
out....

    -Patrick

P.S.  You could also find other changed information (like file size, 
modify date, etc.) by adjusting the "ls" flags....  But if *all* you 
want to know is "What files have gone missing?", then the above should work.



More information about the cvale mailing list