cleaning up

Scott Haneda talklists at newgeo.com
Mon Jan 11 19:20:44 PST 2010


On Jan 11, 2010, at 7:04 PM, Bradley Giesbrecht wrote:

> On Jan 11, 2010, at 5:55 PM, Michael Crawford wrote:
> 
>> If you're worried about losing your payload data, rather than having
>> find delete all the renamed files automatically, have it generate a
>> list of the renamed files that you redirect into a text file.  Examine
>> that file by eye, manually remove any lines containing files that you
>> don't want deleted, then delete the files named in the list by using
>> the backquote shell construction:
>> 
>> $ find BLAH > deleteme.txt
>> 
>> (edit deleteme.txt, remove files that aren't to be deleted)
>> 
>> $ rm `cat deleteme.txt`
> 
> That is an easy and safe approach and the list is not all that long this satisfies my needs.
> 
> In the future I'll also use mv instead of rm incase things go really wrong. If things are ok after a couple weeks I'll rm them.

Be careful with mv, it has caused me great pain in the past.  mv can overwrite a file with no prompt if you tell it to do so, which I did.  On a server, there tends to be a lot of files with the same names, so I ended up with the last file mv'd, and not the hundred of files I thought I was going to end up with.

Just thought I would mention it, it bit me once, which is usually all it takes before I learn my lesson.
-- 
Scott * If you contact me off list replace talklists@ with scott@ * 



More information about the macports-dev mailing list