alpha has one subfolder, and files in both root and in subfolder.
beta has 25 subfolders with files in them.
How would I compare the file contents of
beta, checking for difference in files?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Assuming the file and directory names don't have newlines in them:
diff <(cd alpha ; find . -type f) <(cd beta; find . -type f)
find commands list the files in the directories the
cd changed to and the
diff compares the listings. Output looks like:
1c1,2 < ./b/c/file.x --- > ./b/c/file.d > ./b/c/file.e
< indicating files only in alpha and
> only in beta