Restore

Art Alexion art.alexion at verizon.net
Mon Apr 23 19:37:41 UTC 2007


On Thursday 19 April 2007 15:23, Nils Kassube wrote:
> On Thursday 19 April 2007 18:33, adams wrote:
> > The rm command does not save anything anywhere.  That is why it is
> > called "remove".  :-)
> >
> > But there is a way to get around it, but it requires some effort on
> > the users part.
> >
> > In in the home directory add   alias rm="" to .bashrc and type that
> > in for the current shell on a command line with the prompt
>
> May I suggest you use this alias:
>
> alias rm='echo "Do not use the rm command, use mv instead.";rm'
>
> Please note: The rm command is still there. If you replace the rm command
> with a mv command, you get a feeling of safety because you think your
> alias will prevent desasters. Then on another machine the alias doesn't
> exist and you do remove the files (been there, done that).
>
> > and this does away with user typing rm on a command line to remove
> > a file.  It becomes a null command.
> >
> > Do a mkdir ~/trash  on the command line to create a "trash bin".
> >
> > Now the user must "mv file_name ~/trash"  to get rid of it, but
> > it still exists.  To really really delete a file you/they have
> > to type /bin/rm file_name  and because it requires thinking
> > the user remembers that what they do will destroy the file.
> >
> > I was thinking that maybe in .bashrc one could do something
> > like
> >
> > alias rm="mv $1 ~/trash"
> >
> > where $1 refers to the argument, but $1 is used in C-shell
> > scripting,
>
> No, that doesn't work. An alias accepts no arguments. You would need a
> function instead. It looks like this:
>
> movetotrash () { mv -i $1 $HOME/trash; }

This is much more complicated than it has to be.  There already is a .Trash 
directory; it is easily accessible by typing 'trash:/' in konqueror; no need  
to create another that won't be as easily accessible.

alias rm = "mv $1 $2 $3 $4 $5 ~/.Trash/"

You can add as many argument variables as you reasonably expect files to be 
attempted to be deleted with a single command.  You don't need multiple 
variables to delete multiple files using wild cards, i.e 'rm *.dll' is only 
one variable even if the samba share has hundreds of files so named in it.
-- 

_____________________________________________________________
Art Alexion

PGP fingerprint: 52A4 B10C AA73 096F A661  92D2 3B65 8EAC ACC5 BA7A
Keyserver: hkp://subkeys.pgp.net
The attachment - signature.asc - is my electronic signature; no need for 
alarm.  Info @ 
http://mysite.verizon.net/art.alexion/encryption/signature.asc.what.html
_____________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 309 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kubuntu-users/attachments/20070423/b5088b8b/attachment.sig>


More information about the kubuntu-users mailing list