replacement for rm?

Chuck chuck.carson at gmail.com
Mon Nov 19 15:31:19 UTC 2007


You can either

a) Alias rm to rm -i, which is default for the root user

b) rename rm (to rm.cmd for example) and then create a wrapper script
called rm that does whatever logic you want then calls rm (however, in
your case it would be calling mv if you wanted to move something to a
.Trash folder)

c) Don't let users on your systems that can't be trusted with basic commands.

Just a couple options.

On Nov 15, 2007 2:34 PM, Ryan Golhar <golharam at umdnj.edu> 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?
>
>
> --
> 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