Re: Consolidating? files
- From: Matt Giwer <jull43@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Jun 2007 22:06:24 -0400
rob wrote:
I have an issue that I'm sure has a fairly simple resolution but I am
too inexperienced to figure it out. Basically I have a number of
files spread across several folders and subfolders in my home
directory. Some of these files are duplicates of each other and some
files have completely different content but share the same filename.
What I am trying to do is consolidate all the files in a single folder
with no duplicates and no overwriting files that have the same name.
Does anyone have any ideas how I might go about this?
BTW I am running FC5.
Any help would be greatly appreciated.
There are certainly a dozen ways to do this.
Off the top of my head I would use inside each directory
mv -i * ../newdirectory/
to move them all to the new directory. -i asks if you want to overwrite a filename. Always answer no.
Then
ls -ld directorya/* directoryb/* etc. >tempfile1
then
sort tempfile1 >tempfile2
Now tempfile2 will all the files with the same name clustere. Those which are the same size can be assumed to be the same file or you can check by hand. Then change the names of the duplicate names but different sizes and repeat the first step.
It would be wise to backup all the directories before starting.
--
Taxes on cigarettes are to raise revenues from the addiction.
-- The Iron Webmaster, 3759
nizkor http://www.giwersworld.org/nizkook/nizkook.phtml
Old Testament http://www.giwersworld.org/bible/ot.phtml a6
.
- Follow-Ups:
- Re: Consolidating? files
- From: rob
- Re: Consolidating? files
- References:
- Consolidating? files
- From: rob
- Consolidating? files
- Prev by Date: Consolidating? files
- Next by Date: Re: Consolidating? files
- Previous by thread: Consolidating? files
- Next by thread: Re: Consolidating? files
- Index(es):
Relevant Pages
|