Re: Consolidating? files



On Jun 13, 10:06 pm, Matt Giwer <jul...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
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
nizkorhttp://www.giwersworld.org/nizkook/nizkook.phtml
Old Testamenthttp://www.giwersworld.org/bible/ot.phtmla6

Matt,

Thanks very much for the suggestion. That sounds like exactly what
I'm looking for. Once I get home from work I'll give it a try.
(keeping fingers crossed)

v/r

Rob

.



Relevant Pages

  • Re: Consolidating? files
    ... files spread across several folders and subfolders in my home ... with no duplicates and no overwriting files that have the same name. ... Now tempfile2 will all the files with the same name clustere. ...
    (linux.redhat)
  • Re: OT - Vista Search and Recursive GetFiles
    ... To ensure that the process goes ok I went to delete all the xml files to force a rescan of the tags. ... Since I had changed the folder structure not all were duplicated just the ones where folders were left the same. ... Oh it is the search indexer. ... I asked if a search which is correct would contain files that were not there or duplicates and of course the answer is yes. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OT - Vista Search and Recursive GetFiles
    ... To ensure that the process goes ok I went to delete all the xml files to force a rescan of the tags. ... Since I had changed the folder structure not all were duplicated just the ones where folders were left the same. ... Oh it is the search indexer. ... I asked if a search which is correct would contain files that were not there or duplicates and of course the answer is yes. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OT - Vista Search and Recursive GetFiles
    ... To ensure that the process goes ok I went to delete all the xml files to force a rescan of the tags. ... Since I had changed the folder structure not all were duplicated just the ones where folders were left the same. ... Phone MS support. ... I asked if a search which is correct would contain files that were not there or duplicates and of course the answer is yes. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OT - Vista Search and Recursive GetFiles
    ... To ensure that the process goes ok I went to delete all the xml files to force a rescan of the tags. ... Since I had changed the folder structure not all were duplicated just the ones where folders were left the same. ... Go to CMD window and check with an old DOS command. ... I asked if a search which is correct would contain files that were not there or duplicates and of course the answer is yes. ...
    (microsoft.public.dotnet.languages.vb)