4
I have 2 folders, and I want to know if folder#1
has all the files in folder#2
How can I check this?
4
I have 2 folders, and I want to know if folder#1
has all the files in folder#2
How can I check this?
7
Giving that folder2
for example has an extra file named test4
, but they share all other files in common, you can always use diff
.
diff folder1 folder2
In our case that would return:
Only in folder2: test4
1
Assuming you want to find missing files/directories on folder2 from folder1, you do:
ls folder2 > /tmp/f2.txt
ls folder1 | grep -v -f /tmp/f2.txt
That will list all items present in folder1 but not in folder2, you can do the opposite to find both differences.
A little more information please. What OS? Do you want scripting based solutions, or purely third party programs? – Matrix Mole – 2011-05-26T22:39:07.647