[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trm - a command that removes files into a temporary "trash"





On Sun, 1 Jun 1997, Tal Davidson wrote:

> Oleg!
> 
> Thanks. Next time I'll query more thoroughly through the mans before I
> sit and write.
> 
> Tal Davidson
> 

Then again...
I looked deeper into the "mv -bfV numbered file-to-trash ~/.trash", but
see that it sufferes from the same problem I had in the past - while 
moving files fantastically (and numberating!), it can't move a directory
to trash if there already exists one there of the same name.

Is there any simple way to get around that? (I haven't found any in the
mv man). Otherwise, ... trm

Thanks!
Tal Davidson





> 
> 
> 
> On Sun, 1 Jun 1997, Oleg Goldshmidt wrote:
> 
> > Tal Davidson writes:
> > > Stas!
> > >
> > > The idea was to automate the process of removing files to trash, such
> that
> > > new files moved into a trash that has older files with the same name,
> > > wouldn't replace the old files but rather be renamed with a suffix .0,
> .1
> > > etc. Otherwise, a simple move to trash is one step away from a real
> > > removal.
> > >
> > > Cheers!!
> > > Tal Davidson
> > >
> >
> > So why is "mv -bfV numbered file_to_trash ~/.trash" not suitable?
> > Read "man mv" carefully. Keep in mind, that you can empty your trash
> > from cron in Linux, say, on a weekly basis, and also make it warn you
> > before it does so. I do a similar thing (although I don't use trash,
> > I just have aliased rm to "rm -i" - another good practice, maybe you
> won't
> > need your .trash at all if you do it), with find producing a list of
> files
> > to be deleted, and the result mailed to myself.
> >
> > Typically, you don't need to write C code for administrative tools like
> > this (or much more complicated ones) in UNIX/Linux.
> >
> > Oleg Goldshmidt
> > Berger Financial Research Ltd.
> > goldshmt@netvision.net.il
> >
> 
> 
> 


Follow-Ups: References: