LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] replacing the rm binary :-)

[ILUG] replacing the rm binary :-)

John Madden john+ilug at jmadden.eu
Thu Sep 2 09:23:00 IST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On (01/09/10 20:39), Lisa Muir said:
> I've been thinking about it, and wondering if it would be an idea to
> replace rm with a script based on mv to make it easier to recover from
> incidents like this. It gets complex when you consider the various
> commandline switches and then handling multiple files of the same name
> in wherever you move the files, missing folder context. Was thinking
> of moving files to a zapme folder in some location with a cron script
> to actually delete files or folders in zapme folders which are older
> than 1 week old.
> 
I read somewhere recently that doing this is a bad idea, on the
individual level at least - maybe not so for companies.

Basically, 'rm' is 'rm' everywhere. If you replace it with a protective
wrapper on a system, then people using that system get used to the
protection, and no longer think of 'rm' as 'to all intents and purposes,
that file is now gone'. They eventually rely on the protection, so when
they move systems, and the same wrapper isn't in place, they get hit
hard (probably multiple times) before reverting their behaviour.

On the company level, this could hit you if you upgrade to a new system,
or if some overzealous package management system decides to overwrite
your wrapper with the original 'rm' again!

The best "workaround" I saw was to alias 'rm' to 'rm -i'. At least this
is portable and easy to set up.

- -- 
John Madden -- john at jmadden.eu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFMf17gQBw+ZtKOvTIRAuXRAJ43XBXSIW0BmWceXnUwguH86ZtkVQCfaWfx
aRmyBQPf7o1s6PFOrhjfOik=
=y2xn
-----END PGP SIGNATURE-----


More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell