Reply
Thread Tools
Posts: 310 | Thanked: 383 times | Joined on Jan 2010
#11
Originally Posted by waleed786 View Post
LOL...would that even work? Even after you did sudo gainroot i dont think it can delete everything because many files would be in use
An unlink() used in rm will never fail because a file is in use; you're updating the parent directory, not the file itself (when you delete something).

An rm -rf / will most certainly delete everything if it has permission, unless the terminal crashes first. The only exception would be pseudo-files (ie. stuff in /proc).

Note that when you delete a file on Linux, all programs that have a reference (open file handle) continue to have access to the file until they close it. Unlinking a file merely removes it from the directory, but it still exists until its reference count becomes 0. At that point the blocks are marked free and can be overwritten.

It's why if you delete a big file that's still in use, you won't see the disk space reclaimed until you kill that process (or the process closes the file).

But um, back on topic.

Neat commands to try:

top - Display running processes interactively
vi - Very old, very powerful text editor (remember: type :q to quit)
du - Display disk usage for a directory
netstat - Display open sockets, routing table, etc

Last edited by nightfire; 2010-02-15 at 03:30.
 

The Following User Says Thank You to nightfire For This Useful Post:
pagesix1536's Avatar
Posts: 232 | Thanked: 102 times | Joined on Nov 2009 @ Warren, MI, USA
#12
Gold Five: "Stay on target!"
__________________
N900
TuxRunner.com
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#13
Just in case anyone is wondering:

Inside the Scratchbox SDK environment - it most certainly does try and remove everything.

It probably would work on the N900 as well since it's most likely a busybox version of RM and not the full one.

However, in the main Ubuntu that the SDK runs on you get:
Code:
maemo@maemo-desktop:~$ sudo rm -rf /
rm: cannot remove root directory `/'
So... highly depends what version of RM you're using .
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
blwthompson's Avatar
Posts: 97 | Thanked: 8 times | Joined on Dec 2009
#14
HAHAHAHHAHAHA rm -rf poor kid!
 
Posts: 356 | Thanked: 172 times | Joined on Jan 2010 @ Canada
#15
LMAO

In case it's not totally obvious by now, DON'T run rm -rf unless someone else hands you their N900 and asks you to make it do something funny. Then it's hilarious


Here's a handy one though that won't get you into any trouble:

Code:
sudo gainroot
ifconfig
It will show you information about the various network connections that are active, and is a really easy way to figure out what IP address any of them have.
 
Posts: 336 | Thanked: 610 times | Joined on Apr 2008 @ France
#16
Originally Posted by fatalsaint View Post
Code:
maemo@maemo-desktop:~$ sudo rm -rf /
rm: cannot remove root directory `/'
Try sudo su; rm -rf /*
 
bandora's Avatar
Posts: 1,338 | Thanked: 1,055 times | Joined on Oct 2009 @ California, USA / Jordan
#17
Lol I feel bad for the OP.. he's trying to learn nice cool stuff on the xterm and we're trying to destroy his N900 for him asking that...
__________________
FarahFa.com
 

The Following User Says Thank You to bandora For This Useful Post:
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#18
Originally Posted by CrashandDie View Post
Try sudo su; rm -rf /*
No.. I saw what you were trying but it doesn't work. It launches su and then waits for me to exit and then tries to rm -rf /* as user.

There is two ways to do as you are asking:

echo 'rm -rf /*' | sudo su

or simply:

sudo rm -rf /*

I chose the easier method:

Code:
sudo rm -rf /*
My virtual machine is now toast. Fricking WIN .

Note to self: When teaching people how to FUBAR their linux.. add a * .

ETA: This is awesome.. my Linux didn't crash..
Code:
maemo@maemo-desktop:~$ ls -al /
bash: /bin/ls: No such file or directory
maemo@maemo-desktop:~$
I am getting totally messed up blocks for message boxes.. can't click on anything without errors. So cool.

ETAA (edited to also add ): This should seriously go without warning.. but if you're dumb enough to do the above on a Live system... No - you won't be recovering from that.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!

Last edited by fatalsaint; 2010-02-15 at 07:18.
 
Posts: 540 | Thanked: 288 times | Joined on Sep 2009
#19
While on the evil line of thought ":(){ :|:& };:" (remove quotes) should also be pretty hilarious on someone else linux (though this one will be solved by a reboot, trashing the rootfs is going to require a whole lot more to fix)

See also http://talk.maemo.org/showthread.php?t=44313
 

The Following User Says Thank You to rambo For This Useful Post:
Posts: 352 | Thanked: 231 times | Joined on Jul 2008 @ Vancouver
#20
Originally Posted by qwerty12 View Post
Recommended: rm -rf /
So this is just mean, unless you tested it first. I have no Linux experience and my command line experience is tweaking a .bat file so I can play Doom on a PC.

After reading the flowing post "Man... Harsh" I though it was a real cool command line tweak. so I ran it! - possibly i got the syntax wrong like missing a space or something - nothing happen so I carried on reading the post. only to see i was an idiot. >:P

so I just wanted to say exercise some self control when you see the word "noob"

I am all into experience but you don't teach a baby how to use a sharp knife by giving him a sharp knife.
 

The Following 2 Users Say Thank You to timwatt For This Useful Post:
Reply

Tags
rm -rf /

Thread Tools

 
Forum Jump


All times are GMT. The time now is 23:31.