How can I compare two folder content under linux.
I'm using diff but I want to display only the files with the same names.
At least you can use
diff -s dir otherdir | grep -v "Only in"
ls $1 >/tmp/$$1
ls $2 >/tmp/$$2
join /tmp/$$1 /tmp/$$2
f1=$(find "$D1" -type f)
f2=$(find "$D2" -type f)
for i in $f1; do
echo $f2 | grep $(basename $i) >/dev/null && echo $i
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
4 years ago