Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Even the most advanced and long-time linux users are not immune to the evil vile typeo or mistyped command.
I was having an issue witht he naming of the kernel after a recompile and was not sure which /lib/modules/* directory was active, my solution which I have done many times was to delete all the /lib/modules/* directories and re-compile-install the kernel modules.
rm /lib/modules/* -rf
however in my haste and overconfidence I failed to notice my command was this:
rm /lib/* -rf
the outcome is obvious....
Well as I use gentoo (stage 1) and just finished compiling the system yesterday (after 3 days streight of compiling without supervision everything I could need) I have no packages or backups to restore... off to start another 3 day long compile.
I did something similar where I accidentally typed the wrong extension in an rm -rf command. Of course, it had to happen in a critical system directory. So, what I always do before I ever do a forced recursive remove is double check my command. It certainly saves some headaches. Luckily this happened on my home comp, and not my server. :-)
ah... me too. I had just finished my shiney new gentoo stage 1 install, and I went into /etc to delete all the *~ backup files. So I typed rm *~, not noticing that my '~' was in a different place than I was used to, and the key I pressed did nothing. So the command was 'rm *' . There went my /etc....
I think I will write a perl script that I will alias to rm that will run the rm command as typed, however if it is an obvious bad combo like rm in /lib or /etc, and so on it will call the user an idiot and not do it.......
lol, that would work if I didn't consider myself one of the users. damn, biggest mistake in the 5 years I have been on linux.. oh I take that back, purchasing redhat9.1 when I found myself without a slackware cd or internet access for a week... I was better off without the computer and the $$$ in my pocket. (Vacation)
It creates a 0-byte length file by the name of
-i in the directories in question ...
If you run an rm in those it's being interpreted
as a -i switch to rm, thus asking you (only in
those specially protected directories) whether
you're SURE you want to do that.
lol yeah, usually I have an alias making -f a given, so it never prompts me.. this dounside is obvious, though in 5 years it is the first time I screwed up on an rm command (though I have screwed up many other ways)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.