I typed
#!/bin/sh
cd /
xx xxx x
by mistake in the shell. I eventually erased everything in my OS, but some programs. I must restore all I lost!
Can I?
It’s very important for me! Please, help me!
I typed
#!/bin/sh
cd /
xx xxx x
by mistake in the shell. I eventually erased everything in my OS, but some programs. I must restore all I lost!
Can I?
It’s very important for me! Please, help me!
Are you serious? You typed everything including the #!/bin/sh line? Why did you do that? This script is the classic delete everything script and you typed it in?
Anyway the answer is no. I hope you had a backup.
I mistook an online guide.
I can’t believe it. I have to repeat hours of work.
Hi
I edited your post to remove the command… What online guide was this?
I feel your pain.
fiertel91 wrote:
>
> I typed
>
>> #!/bin/sh
>> cd /
>> xx xxx x
>
> by mistake in the shell. I eventually erased everything in my OS, but
> some programs. I must restore all I lost!
>
> Can I?
>
> It’s very important for me! Please, help me!
>
>
I’m very embarassed, but it’s this one: SDB:Login as root - openSUSE.
Sometimes I work without reading well (or without reading at all). And the language is not always my friend.
It’s only part your fault. The real blame lies with the author of the wiki page. I’ve edited that wiki page and removed the line that deletes everything, so no one else falls into the trap.
malcolmlewis wrote:
> I edited your post to remove the command… What online guide was
> this?
i guess it is ok to leave them in nntp as ‘most’ users there have
enough experience to . . . well, no they do not…
when the OP has been helped to recover what is possible (if anything)
i suggest this thread be expunged totally…
–
palladium
This is one of those that should be discussed in the wiki forum.
It is unfortunate that the OP used this command and lost important data. That section of the wiki should have had a warning. That particular command would be equivalent to running
deltree C:\
in Windows. Although I believe Windows does have some failsafes to protect against such things.
When using that particular command, which with out those arguments and options can be quite safe, it is always a good idea to read the man page and pay close attention to the arguments. Recursive and force, means it will go through each directory in the option, and the force arguments…well, that says it all. When you combine them, especially as root user, its playing with fire.
I also think this thread should be made a sticky as a warning for other users.
It sounds like a crazy story. >:(
I’m not sure, because I always replace bash default config as well as shell aliases on Linux, but I think most distros alias rm, cp and mv by default to rm -i, cp -i and mv -i, in order to prevent users (and root!) for removing files by mistake. But Linux is not Windows: It gives you the freedom to destroy everything. On the other hand, writing such an example (without an explicite warning) on a wiki page is totally irresponsible.
Wait a minute ! I’m trying to figure out what this command really did.
What’s left in the / directory? On my system, just a couple symlinks I created myself. You could not have lost any data. Is it a joke?
Unfortunately the command was with recursive and force
Just has been edited so nobody uses it any more
You could see it in the wiki by “versions”
Pfoooh, please_try_again, cheers for some decent reading and thinking. Whether it’s a joke or not, this is not funny, simply not true.
EDIT: @please_try_again: he’s right, we overlooked the fact that the original post had been editted. Apology for the above
please try again wrote:
> - it could not remove directories without the recursive option (which
> I’m not going to type here)
the original un-moderator edited post had both the recursive and force
flags set…
–
palladium
At least the original wiki page explained what the famous command would do:
root can erase the complete system unintentionally.
I am happy that the OP did not see my old avatar (and blame me).
After discussing this matter with the wiki team, we have restored the code snippet, but added a warning. The entire article is kind of a what not to do as root. The cautions of being root. Since that is the purpose of the article, it makes sense to restore the code. SDB:Login as root - openSUSE
I ask that when you have questions or comments about an article, you post it here openSUSE Wiki Discussions - openSUSE Forums Then we can make appropriate edits.
Hi
Did an additional edit to remove swerdna’s text…
–
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.42-0.1-default
up 8 days 10:18, 4 users, load average: 0.24, 0.11, 0.09
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53
Works for me…
On 2010-02-16, fiertel91 <fiertel91@no-mx.forums.opensuse.org> wrote:
> by mistake in the shell. I eventually erased everything in my OS, but
> some programs. I must restore all I lost!
>
> Can I?
>
> It’s very important for me! Please, help me!
Forget it.
First, reinstall the complete system. No point to do anything less, now.
As for your data and personal settings… you have a backup, of course ?
–
Any time things appear to be going better, you have overlooked
something.
Is there any software which can recover the deleted directories or the whole deleted system?
It would be great if one command is created it should go with its opposite command or a switch such as delete and recover or backup and restore. A good command should have its counterpart to keep balance. We are human beings and each makes mistakes everyday. That’s normal. It’s important for all of us to have chances to correct those mistakes. Maybe it’s also a good idea when one is trying to use such a command and a big warning jumping out telling what the consequence would be or a friendly reminding to back up all necessary things before carrying out the command.