Timeline for Linux: Compare Directory Structure Without Comparing Files
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 13, 2017 at 12:01 | comment | added | Jay M | diff <( tree -i dir1 ) <( tree -i dir2 ) is by far the best answer. I'm tempted to downvote all answers that suggest diff or rsync as the question explicitly says NOT to read the file contents. NOTE: The suggestion of using two pipes requires careful use of spaces between brackets, follow the example exactly. E.g. to compare two 20G volumes after a backup the tree answer took about 5 seconds. The others took 20+ minutes. | |
Dec 10, 2015 at 17:31 | comment | added | askewchan |
I recommend running tree with the i flag, which doesn't print the tree lines (tree -i dir1 , etc). If the directory structure is different in one place, the other files that do match may have more or fewer | symbols in the tree output, and diff will catch those lines even if the file paths are identical.
|
|
Dec 18, 2014 at 19:46 | comment | added | Joel Mellon |
Or to avoid the tmpfiles, diff <( tree dir1 ) <( tree dir2 )
|
|
S May 31, 2014 at 14:33 | review | Late answers | |||
May 31, 2014 at 14:57 | |||||
S May 31, 2014 at 14:33 | review | First posts | |||
May 31, 2014 at 16:53 | |||||
May 31, 2014 at 14:18 | history | answered | digit | CC BY-SA 3.0 |