# newbie question: how find different files in two directory trees?



## ivand58 (Jun 20, 2009)

Hi all,

the problem:
I have two discs with almost same folders and files. I need to merge their content. So i need to find the different files. This is not about a simple merge, i have to keep some files and to remove others. 

up to now:

I tried with 
	
	



```
diff
```
 but it doesn't works for me, because it not only shows the filenames, but dumps their contents too.

Next I tried whit 
	
	



```
diff
```
of the 
	
	



```
ls -lha
```
, but there are few problems - (1) the mount points are different and (2) some times the owner of two files is not the same, but the content is the same.

the question:

is there a simple way (say less than 10 line of code) to find files that are different or not present form one directory structure to another?


----------



## DutchDaemon (Jun 20, 2009)

Try [cmd=]diff -q dir1 dir2[/cmd].


----------

