From 3d30c2c0e3f09691d2af96bb7e315b54ef68923a Mon Sep 17 00:00:00 2001 From: Mohit Pant <168906022+mohitpant1010@users.noreply.github.com> Date: Thu, 7 Aug 2025 22:54:08 +0530 Subject: [PATCH] Added diff -r command example and explanation in directories_comparison.md (#10596) --- .../shell/solutions/directories_comparision.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 exercises/shell/solutions/directories_comparision.md diff --git a/exercises/shell/solutions/directories_comparision.md b/exercises/shell/solutions/directories_comparision.md new file mode 100644 index 0000000..c94d047 --- /dev/null +++ b/exercises/shell/solutions/directories_comparision.md @@ -0,0 +1,13 @@ +## How to compare two directories in Linux? + +You can use the 'diff' command with the '-r' flag to compare two direcotries recursively. + + + +### Example: +'''bash +diff -r folder1/ folder2/ + +This command compares all the files and subdirectories inside 'folder1' and 'folder2'. +If both directories have identical contents, it retuns nothing. +If there are differences,it showss which files differ or are missing.