Doryforos Posted October 16, 2003 Share Posted October 16, 2003 Hello,Something I just discovered:RedHat 9.0 installs, by default, different .bashrc files for root, than those of the other users:root's .bashrc contains the following aliases: alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' This means that delete, copy and move operations, will NOT by default delete, or overwrite any already existing files, without first asking for your explicit permission ("-i" stands for "interactive").This is not the case, however, for simple users (why, RedHat?). <_<If you want to practise safe hex , edit your (and any of your system's already created user's) ~/.bashrc, to include the above lines (read root's for their specific place in the file), AND /etc/skel/.bashrc, so that any newly created user's .bashrc will have those potentially catastrophic commands de-fanged. Quote Link to comment Share on other sites More sharing options...
Owyn Posted October 16, 2003 Share Posted October 16, 2003 Just had to check. This is clean in Mandrake 9.1Also double checked the cp, rm, and mv commands. They all support the "-f" (--force) switch. This lets you override "-i" when you need to. Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 Hi DoryforosI think the -i option is a good thing for "rm", but to have them for "cp" and "mv" too is a bit overdone. I would not want to have to confirm every command I give . . Bruno Quote Link to comment Share on other sites More sharing options...
Guest LilBambi Posted October 16, 2003 Share Posted October 16, 2003 I agree Bruno! Quote Link to comment Share on other sites More sharing options...
Ragnar Paulson Posted October 16, 2003 Share Posted October 16, 2003 Reminds me of one of my first days in unix... I was in chatting with the sysadmin when a developer rushed in, seems she had accidentally removed a file with a few hours work in it. When informed that it was really and truly gone the developer fumed loudly about the (chose expletitive) unix operating system and how in her old job and the VM system (yeah this was a while ago) histories of all file changes were preserved (file.1, file.2 ... etc) automatically and you could always recover from such errors easily. To which the sysadmin drolly replied, "It should not be astonishing functionality in an operating system that if you ask it to remove a file ... it actually removes the file". Ragnar Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 To which the sysadmin drolly replied, "It should not be astonishing functionality in an operating system that if you ask it to remove a file ... it actually removes the file". LOL Rangar !! I like that one !!And as we´re talking CLI: Here is a nice article about "CLI for novices: alias cat and pipe meet grep" Bruno Quote Link to comment Share on other sites More sharing options...
Guest LilBambi Posted October 16, 2003 Share Posted October 16, 2003 (edited) LOL! I love that one too Ragnar! Imagine that an OS that does what you tell it LOL! :w00t:EDIT: Bruno, could you check that link again, I couldn't get there when I clicked on it. It said 404 not found. Edited October 16, 2003 by LilBambi Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 Sorry the link works for me Fran . . . .Here it is in full glory: http://newsforge.com/article.pl?sid=24603/10/10/158The article is written by our good friend Joe Barr ! Bruno Quote Link to comment Share on other sites More sharing options...
linuxdude32 Posted October 16, 2003 Share Posted October 16, 2003 To which the sysadmin drolly replied, "It should not be astonishing functionality in an operating system that if you ask it to remove a file ... it actually removes the file". That's classic! Reminds me of the saying "make a foolproof system, and they'll make a better fool".Curiously, there is a program that prevents files from actually being deleted, so you can recover them. It's called safedelete and hasn't been updated in years, but I tried it and it works. Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 I made the command "del" and it moves the file to the trash-bin instead of delete it . . . Bruno Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 Here it is: #!/bin/bashmv $1 /home/bruno/Desktop/Trash#end script I called it "del" and put it in /usr/bin . . . very simple . . :teehee: Bruno Quote Link to comment Share on other sites More sharing options...
Owyn Posted October 16, 2003 Share Posted October 16, 2003 Nice.... Idea stolen.... Quote Link to comment Share on other sites More sharing options...
Bruno Posted October 16, 2003 Share Posted October 16, 2003 It´s GPL, . . . . . . so you´re free to take and adapt to your own prefs . . . :teehee: Bruno Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.