Weeding out duplicate odt/doc files
Michael.Zoet at michaelzoet.de
Tue Sep 4 14:13:02 UTC 2007
> I have this box equipped with a single 40GB harddrive shared by
> Win98SE / SuSE9.2 / Kubuntu 7.04.
> There are two partitions that harbor respectively Kubuntu (hda3 - ext3
> - 11GB) and SuSE9.2 (hda5 - ext3 - 13GB).
> While the contents of these two partitions differ considerably from
> one another, hda5 still contains several hundred text files (some Word
> docs, some OO odt's) that are identical with files on hda3.
> I'm going to continue working with Kubuntu (my favorite distro) but
> must clear the SuSE partition to make room for other stuff.
> The idea is to delete any duplicate text/doc versions from hda5 (SuSE)
> and move all the non-duplicate ones to hda3 (Kubuntu) before I
> reformat hda5.
> For good measure I've backed up the /home folders of both distros and
> some other items like e.g. Thunderbird profiles.
> My question: is there a good way of determining which text/doc files
> are identical across the two distros (by filename and modification
> date, or by content), short of doing it manually?
There are some nice tools to get the work done:
cmp - compare two files byte by byte on the command line
diff - compare files line by line on the command line
Please see "man cmp" and "man diff" for the full feature set.
These are the old school Unix tools every Unix/Linux system should have.
With diff you can compare hole directories:
diff <PATH_TO_DIRECOTRY_ONE> <PATH_TO_DIRECOTRY_TWO>
With compare you have to provide every file by hand. Or make use of a
loop (for, while, etc.) on the command line or write a shell script.
If you like GUIs more: last week I stumpled over a KDE programm called
"Komparator is a KDE application that allows the user to search two
directories and synchronize them interactively. Unlike other (command
line) tools the user has intuitive control over what is done."
I tested it once and it seems to work. Install it with "sudo apt-get
Also there are two other tools specializing in directory and file
rsync - command line only. Install it with "sudo apt-get install rsync"
unison - command line and GUI programm. Install it with "sudo apt-get
install unison" for the command line and "sudo apt-get install
unison-gtk" for the GUI version.
ATTENTION: please read the manual pages before using rsync or unison and
make backup copies of the directories for the first use. If you do
something wrong you might delete your files!
For your problem I would use unison.
P.S.: the manual page for unision is build in. Type "unison -doc topics"
on a command line to get the topics and "unison -doc tutorial | less"
for the tutorial.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the kubuntu-users