I'm trying to get diff to output only the name of the modified files. I tried to use the -q option but it's still giving me too much output :
What i get now is this :
files path/to/file1/file1 and path/to/file2/file2 are different
And i would like this :
path/to/file1/file1
Any ideas on how to do this ?
Use the exit status of diff:
if ! diff -q file1 file2 >/dev/null; then echo file1; fi
You could do:
diff -q file1 file2 | cut -f2 -d' '
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With