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

RE: replacement for rm?



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 redhat com
[mailto:redhat-list-bounces 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 merck com> wrote:
> Perhaps you should restrict yourself to a gui, like xfe. :)
>
>
> -----Original Message-----
> From: redhat-list-bounces redhat com
> [mailto:redhat-list-bounces 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 redhat com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list


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