You are not logged in.
Hi there
I have two dirs with nearly the same content.
Lets call them A and B.
A contains some files which are not in B, I want to a list of these files. I do not care about files existing in both dirs which have not the same content. It's only about the files existing or not.
My first thought was something like that
$ find A > contentOfA
$ find B > contentOfB
$ diff contentOfA contentOfB
but here I also get files which are in B but not in A.
Is there an easier way to do this?
Regards,
Keen
Last edited by keen90 (2011-09-25 15:18:44)
Offline
---sorry no post
Last edited by keen90 (2011-09-25 14:15:00)
Offline
Use 'comm' instead of diff - 'man comm'.
comm -23 contentOfA contentOfB
should do.
You can use diff like this
[karol@black ~]$ tree
.
├── A
│ ├── a
│ ├── b
│ ├── c
│ └── d
└── B
├── a
├── b
├── e
└── f
2 directories, 10 files
[karol@black ~]$ diff A B
Only in A: c
Only in A: d
Only in B: e
Only in B: f
Last edited by karol (2011-09-25 14:38:21)
Offline
Using the rsync command with the --dry-run option like that :
rsync --dry-run --ignore-existing --verbose A/* B
Take care not to forger the --dry-run option to do nothing but to show the files in A which don't exist in B.
Offline