linux - How to get `diff -qr` to display all files under subdirs? -
let's file tree:
a a/file1 a/subdir1 a/subdir1/file1 a/subdir1/file2 b b/file1 when run diff -qr b, returns below. doing recursive diff, doesn't list files under subdir.
files a/file1 , b/file1 differ in a: subdir1 what see below. there diff options this?
files a/file1 , b/file1 differ in a: subdir1 in a: subdir1/file1 in a: subdir1/file2 (note: using ubuntu, gnu diffutils 3.2)
the reason why output when running diff -qr b because subdir1 in a. because of that, under a must different in b apparently doesn't go through , list files. haven't found way list files regardless. put command help!
my file structure:
matt@mattpc ~/perl/testing/10 $ find . . ./a ./a/file1 ./a/subdir1 ./a/subdir1/file1 ./a/subdir1/file2 ./b ./b/file1 the diff command ran (same output):
matt@mattpc ~/perl/testing/10 $ diff -q -r b in a: subdir1 here's command wrote need. basically, calls find a , find b , pipes output diff compare them. however, have pipe sed 's/^[^/]\+//' remove name of first directory, in case a , b.
matt@mattpc ~/perl/testing/10 $ diff <(find | sed 's/^[^/]\+//') <(find b | sed 's/^[^/]\+//') 3,5d2 < /subdir1 < /subdir1/file1 < /subdir1/file2 hope helps! let me know if command needs tweeking.
Comments
Post a Comment