replacement for rm?

Ray Van Dolson rvandolson at esri.com
Thu Nov 15 22:37:58 UTC 2007


On Thu, Nov 15, 2007 at 05:34:43PM -0500, Ryan Golhar wrote:
> Here is a general question...
>
> Occasionally I've accidentally deleted files using rm and sometimes rm -rf 
> in my home directory.
>
> Has anyone ever thought of a "safe" rm that moves files into the users 
> .Trash directory instead of actually deleting the file?

You could alias rm to rm -i or rm -I.  Or make a more complicated
alias/function that actually moves the files in question to your
.Trash. :)

Probably is some 3rd party util out there that would do what you ask,
but I think aliasing to rm -I would probably work for most cases.

Ray




More information about the redhat-list mailing list