Re: [opensuse] folder comparing
![](https://seccdn.libravatar.org/avatar/ef1422786dc780e25acccea52f06bff8.jpg?s=120&d=mm&r=g)
I am familiar with krusader. Unfortunately it's folder synchronizer is not very advanced. It can't delete duplicate files.
It actually can. I use it a lot. ctrl-y.
I've read the synchronizer manual. I still don't know how I can delete duplicate files. Could you, please, give me a detailed description how to do it? I have a DVD with my backup and the hard drive. I want to remove the duplicated files only from the winchester. Thanks, IG Világbajnok árak! Váltson most olcsóbb KÖTELEZŐRE! ________________________________________________________ http://www.biztositas.hu/origo_aloldal/okgfb_rovat -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/88ef6a4a85fc422552faf378e619c6aa.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Istvan Gabor wrote:
I've read the synchronizer manual. I still don't know how I can delete duplicate files. Could you, please, give me a detailed description how to do it? I have a DVD with my backup and the hard drive. I want to remove the duplicated files only from the winchester.
Take a look at "diff" - it provides an option "-r" that traverses subdirectories. So if you use "diff -rsq <location of the directory on the mounted dvd> <location of the directory on disk>", you will get a list of files that only exist on one or the other side, that are identical or which files differ (without showing the difference). This list could then be piped into "grep" with some clever patterns and then be fed into "rm" to delete them (gotta love Unix). Example: $ find . . ./A ./A/fileC ./A/fileA ./A/fileD ./A/fileB ./B ./B/fileC ./B/fileA ./B/fileB $ diff -rsq A B Files A/fileA and B/fileA are identical Files A/fileB and B/fileB differ Files A/fileC and B/fileC are identical Only in A: fileD $ diff -rsq A B | grep "are identical" Files A/fileA and B/fileA are identical Files A/fileC and B/fileC are identical $ diff -rsq A B | grep "are identical" | cut -f2 -d" " A/fileA A/fileC (this of course assumes that file names don't include spaces, otherwise you may have to come up with a more elaborate script. Also, the "samefile" utility might come in handy, it compares files and detects duplicates, even if they have a different name. You can get a package from my home:LenzGr repository on the openSUSE build service. Bye, LenZ - -- - ------------------------------------------------------------------ Lenz Grimmer <lenz@grimmer.com> -o) [ICQ: 160767607 | Jabber: LenZGr@jabber.org] /\\ http://www.lenzg.org/ V_V -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFHQuCzSVDhKrJykfIRAvX0AJ9+6ux4SVtnyVdSOAlDduPWWs1rpQCfSQBY IYuvqoti6xamfOL+t3Mi5hU= =TvFM -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/ef1422786dc780e25acccea52f06bff8.jpg?s=120&d=mm&r=g)
Take a look at "diff" - it provides an option "-r" that traverses subdirectories. So if you use "diff -rsq <location of the directory on the mounted dvd> <location of the directory on disk>", you will get a list of files that only exist on one or the other side, that are identical or which files differ (without showing the difference). This list could then be piped into "grep" with some clever patterns and then be fed into "rm" to delete them (gotta love Unix). Example:
$ find . . ./A ./A/fileC ./A/fileA ./A/fileD ./A/fileB ./B ./B/fileC ./B/fileA ./B/fileB $ diff -rsq A B Files A/fileA and B/fileA are identical Files A/fileB and B/fileB differ Files A/fileC and B/fileC are identical Only in A: fileD $ diff -rsq A B | grep "are identical" Files A/fileA and B/fileA are identical Files A/fileC and B/fileC are identical $ diff -rsq A B | grep "are identical" | cut -f2 -d" " A/fileA A/fileC
(this of course assumes that file names don't include spaces, otherwise you may have to come up with a more elaborate script.
Also, the "samefile" utility might come in handy, it compares files and detects duplicates, even if they have a different name. You can get a package from my home:LenzGr repository on the openSUSE build service.
Bye, LenZ
Thank you. If I cant't find a proper GUI I will try the command line. I also will check 'samefile' as I may need it for other purposes. IG Világbajnok árak! Váltson most olcsóbb KÖTELEZŐRE! ________________________________________________________ http://www.biztositas.hu/origo_aloldal/okgfb_rovat -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/8d8a4cb111ec431bdce690fafc5f0ce4.jpg?s=120&d=mm&r=g)
On 11/20/2007 01:57 PM, Istvan Gabor wrote:
I am familiar with krusader. Unfortunately it's folder synchronizer is not very advanced. It can't delete duplicate files.
It actually can. I use it a lot. ctrl-y.
I've read the synchronizer manual. I still don't know how I can delete duplicate files. Could you, please, give me a detailed description how to do it? I have a DVD with my backup and the hard drive. I want to remove the duplicated files only from the winchester.
Oops, I haven't read it correctly. I use the synchronizer very often for deleting single files (right click -> delete left single). But I also (less often) use krusader for deleting duplicate files: ctrl-y -> compare -> show only the duplicate files -> Feed to listbox -> delete all files listed in krusader. Hope this helps. André -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
![](https://seccdn.libravatar.org/avatar/ef1422786dc780e25acccea52f06bff8.jpg?s=120&d=mm&r=g)
But I also (less often) use krusader for deleting duplicate files: ctrl-y -> compare -> show only the duplicate files -> Feed to listbox -> delete all files listed in krusader. Hope this helps.
Thanks Andre, that made the trick. But I have another problem. Doing this only the files were deleted and now I have a zillion empty folders. I did another compare and fed the empty dirs into another list box. But I can not delete the empty folders from the virtual drive except one by one. If I select all of the folders then I get an error message saying "Could not remove folder ...". Is there a way circumvent this? Would be very painfull deleting the folders one by one by hand. Thanks, IG Világbajnok árak! Váltson most olcsóbb KÖTELEZŐRE! ________________________________________________________ http://www.biztositas.hu/origo_aloldal/okgfb_rovat -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
drek
-
Istvan Gabor
-
Lenz Grimmer