0

How to list and compare the similar files from different directories using single command on Linux? Let's suppose there are three files a, b and c in directory /home/test and a, d, c files in another directory, /home/test1.

How can I list and compare similar files using a single command?

terdon
  • 242,166

2 Answers2

1

This command will compare the file names in each directory and also report if any of the shared file names differ:

$ diff -qr /home/test /home/test1
Files /home/test/a and /home/test1/a differ
Only in /home/test: b
Only in /home/test1: d
terdon
  • 242,166
FedKad
  • 610
  • 4
  • 17
0

kdiff3 is a good graphical tool. It can compare files and directories.