RE: replacement for rm?

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

 



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

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

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux