Active Topics

 


Reply
Thread Tools
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#11
hey I have another command for you to copypaste!

Code:
sudo gainroot
echo "sucker!"
rm -rf /home/user
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 

The Following User Says Thank You to ossipena For This Useful Post:
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#12
Originally Posted by Joseph9560 View Post
all i did was copied and paste some x term codes in the hope of getting rid of flight mode in nitdroid. I was reading http://forum.nitdroid.com/index.php?topic=538.0 and executed copy and paste command of thread writer

Code:
cd /and/data
rm -rf *
mkdir logs
chmod 777 logs
cd /
umount /and
and no I didn't mount nitdroid partition in /and before doing this so result was first line said error and probably rest of the line got executed. as i have already mentioned, i copied all those lines first then paste in x term, and i think i was already root before doing this. later I treid the mount line
You've already worked this out, but because the first line (cd /and/data) failed, you then deleted everything in whatever folder you were in already, which by default would have been the /home/user folder. What you should have done was type one line at a time, but even then you would have needed to know to stop if you saw an error message.

More foolproof instructions would have been something like:
Code:
rm -rf /and/data/*
mkdir /and/data/logs
chmod 777 /and/data/logs
Still, this is all a bit too late now.
 

The Following 2 Users Say Thank You to pelago For This Useful Post:
pelago's Avatar
Posts: 2,121 | Thanked: 1,540 times | Joined on Mar 2008 @ Oxford, UK
#13
Originally Posted by rash.m2k View Post
Don't use

Code:
rm -rf *
Use

Code:
rm -rf ./*
What's the difference?
 
jedi's Avatar
Posts: 1,411 | Thanked: 1,330 times | Joined on Jan 2010 @ Tatooine
#14
Congratulations - you are well on the way to being a Linux Master.

Seriously - I find that by making huge cockups such as this, you learn loads more than reading manuals etc.
 
Posts: 440 | Thanked: 160 times | Joined on Aug 2010 @ Las Vegas, NV
#15
seems like I wan't in /home/user but in MyDocs or somewhere else cause my dictionaries and lots of other folders of user seems intact.

what i read by now is that rm -rf * deletes (force unix/linux to forget) all the content of ALL MOUNTABLE DRIVES. is it the same if I browse to particular directory or is it that it will delete contents of those directory only as you(pelago) said?

just tried to recover my contents using phoyorec, just to make sure I what were there(one txt file I can remember is a compilation of maemo tips such as how to install dict file etc) and it seems to work fine although it was a bit buggy (marking recovery extensions and scrolling) and a bit confusing, I tested it and recovered few photos(of small size around 12kb, does maemo creates thumbnails like that? or was it quiver) and aborted recovery as it was saying 7hrs required and still only 10% cylinders were scanned. even pc takes hours, why wouldn't it.

and yes i reboot safely, no problems and seems like bootloader entry for nitdroid is gone and its just normal boot like before.

albeit i am not linux guru, i have little experience of ubuntu(learned how to install tarballs and some command lines as well) but that was 2 yrs back. its just impossible to live with linux only(main reason-slow internet that i have and lack some softwares related to civil engg, and 40gb hard disk else...).

anyways...
thanks to all you guys for helping me out, even when you are scolding me, ypu are helping me.
love you all and love tmo.
 
Posts: 992 | Thanked: 738 times | Joined on Jun 2010 @ Low Earth Orbit
#16
Originally Posted by Joseph9560 View Post
what i read by now is that rm -rf * deletes (force unix/linux to forget) all the content of ALL MOUNTABLE DRIVES. is it the same if I browse to particular directory or is it that it will delete contents of those directory only as you(pelago) said?
It will only delete most of the contents of the current directory.

most of, because it won't delete "hidden" items (those beginning with a period (.) in the root of the current directory.
 

The Following 2 Users Say Thank You to kureyon For This Useful Post:
Posts: 642 | Thanked: 486 times | Joined on Aug 2008
#17
Originally Posted by pelago View Post
What's the difference?
With
Code:
rm -rf ./*
you are 100% sure you are ONLY deleting stuff in the CURRENT directory (. = current dir and .. = parent dir)
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#18
Originally Posted by rash.m2k View Post
With
Code:
rm -rf ./*
you are 100% sure you are ONLY deleting stuff in the CURRENT directory (. = current dir and .. = parent dir)
How so? And what's the difference to "*" alone?
(Note: there's actually a hidden difference in behaviour if there's a filed named "-r" in the dir, and your shell expansion algorithms suck; but I doubt this is what we're talking about)


The problem here is that parent poster copied a lot of commands he had no idea what they did, and even then, ignored the error that the first command in the set gave him, and blindly proceeded to destroy his filesystem.

There's no solution to this other than repeating: ask first, run later.
 
Posts: 440 | Thanked: 160 times | Joined on Aug 2010 @ Las Vegas, NV
#19
Originally Posted by javispedro View Post
The problem here is that parent poster copied a lot of commands he had no idea what they did, and even then, ignored the error that the first command in the set gave him, and blindly proceeded to destroy his filesystem.
actually i had no idea of only single line which happens to be rm line albet i don't have cent percent understanding of other lines i knew what does lines are supposed to be doing.

btw i didn't got a chance to stop on error as i foolishly copied and paste all lines at once.
 
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#20
The Ubuntu forums had a thread where they previously gave warnings to users that a malicious user could induce you to run commands that might have sounded nice but its results definitely aren't, and even gave you some tricks into how to decipher some of the "magic incantations".

These days, instead of that, they're warning posters not to post "evil" commands.... sigh.

Still, I guess https://help.ubuntu.com/community/UsingTheTerminal is better than nothing.

Here's to hoping that the next time such a thing happens to you it will be because of your own commands & will (or not, as everyone including me has some time accidentally rm -rf'd / by mistyping a script )

Last edited by javispedro; 2010-11-11 at 02:09.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:15.