Added a shorter solution for the directory diff exercise (#344)

Signed-off-by: Fabio Kruger <10956489+krufab@users.noreply.github.com>
This commit is contained in:
krufab
2023-02-02 12:00:23 +01:00
committed by GitHub
parent 47c39f6e9a
commit c664d2e7e2
2 changed files with 10 additions and 3 deletions

View File

@@ -4,7 +4,7 @@
1. You are given two directories as arguments and the output should be any difference between the two directories
### Solution
### Solution 1
Suppose the name of the bash script is ```dirdiff.sh```
@@ -26,5 +26,12 @@ then
fi
diff -q $1 $2
```
```
### Solution 2
With gnu find, you can use diff to compare directories recursively.
```shell
diff --recursive directory1 directory2
```