Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Everything erased through the shell by mistake

  1. #1

    Default Everything erased through the shell by mistake

    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!
    Last edited by malcolmlewis; 16-Feb-2010 at 05:53. Reason: removed command

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Everything erased through the shell by mistake

    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.

  3. #3

    Default Re: Everything erased through the shell by mistake

    I mistook an online guide.

    I can't believe it. I have to repeat hours of work.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    25,456
    Blog Entries
    15

    Default Re: Everything erased through the shell by mistake

    Hi
    I edited your post to remove the command.... What online guide was this?

  5. #5

    Default Re: Everything erased through the shell by mistake

    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!
    >
    >
    Last edited by malcolmlewis; 16-Feb-2010 at 05:54. Reason: removed command

  6. #6

    Default Re: Everything erased through the shell by mistake

    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.

  7. #7
    Join Date
    Mar 2008
    Location
    Oz
    Posts
    11,716
    Blog Entries
    2

    Default Re: Everything erased through the shell by mistake

    Quote Originally Posted by fiertel91 View Post
    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.
    Leap 42.2 & Leap 42.3 [&KDE]
    FYIs from the days of yore

  8. #8
    palladium NNTP User

    Default Re: Everything erased through the shell by mistake

    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

  9. #9
    Join Date
    Jun 2008
    Posts
    1,825
    Blog Entries
    1

    Default Re: Everything erased through the shell by mistake

    Quote Originally Posted by swerdna View Post
    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.
    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
    Code:
    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.
    ______________________________________________________________________________________
    Don't ask "if" something can be done, for it can always be done. Rather instead ask "How" can it be done.

  10. #10

    Default Re: Everything erased through the shell by mistake

    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.

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •