replacement for rm?

Johan Booysen johan at matrix-data.co.uk
Fri Nov 16 08:57:10 UTC 2007


http://joedonner2001.wordpress.com/red-hat-enterprise-linux-5/make-rm-co
mmand-move-deleted-items-to-trash/

In your home directory (/root, for example), add the following line to
the (hidden) file .bashrc:

# create an alias so that rm actually moves deleted stuff to Trash
alias rm='mv -target-directory ~/.Trash' 

Basically, when you now run the rm command to delete a file or folder,
you will actually invoke the mv command to move the file or folder to
Trash.


-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Herta Van den Eynde
Sent: 16 November 2007 08:01
To: General Red Hat Linux discussion list
Subject: Re: replacement for rm?

On 16/11/2007, Northrup, Wilson <wilson_northrup at merck.com> wrote:
> Perhaps you should restrict yourself to a gui, like xfe. :)
>
>
> -----Original Message-----
> From: redhat-list-bounces at redhat.com
> [mailto:redhat-list-bounces at redhat.com] On Behalf Of Ryan Golhar
> Sent: Thursday, November 15, 2007 5:35 PM
> To: General Red Hat Linux discussion list
> Subject: replacement for rm?
>
> 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?
>

Just bear in mind that if you are going to name this tool 'rm', it will
be idiosyncratic to your system.  If you need to work on another system
and rely on 'rm' moving your files aside instead of deleting them,
you'll be in trouble.
Best train yourself to check your commands before hitting the <Enter>
key.

Kind regards,

Herta

-- 

redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list