dirdelta is a small Bash utility that compares two directory trees and reports
regular files that are present in one tree but missing at the same relative path
in the other. It does not copy, modify, or delete any files.
./dirdelta parentDir1 parentDir2The script requires exactly two arguments.
Given two parent directories, the script:
- Lists files in
parentDir1that are missing fromparentDir2. - Lists files in
parentDir2that are missing fromparentDir1. - Reports when one directory contains every file found in the other.
Files are compared by relative path, not by content. A file present at the same relative path in both directories is treated as present even when its contents differ. Hidden files are included in the comparison.
Before running the script:
dir_1/
├── file_1.txt
├── file_2.txt
└── notes/today.txt
dir_2/
├── file_2.txt
├── file_3.txt
└── drafts/idea.txt
Run:
./dirdelta dir_1 dir_2Output:
Files not found in dir_2:
dir_1/file_1.txt
dir_1/notes/today.txt
-----------------
Files not found in dir_1:
dir_2/file_3.txt
dir_2/drafts/idea.txt
- The script does not compare file contents.