How to compare the contents of two directories in Linux?

You can use diff command to compare the contents of directories. To compare directories instead of files pass directory path instead of file path in diff command.