Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
A note to those of you new to Linux, and even the veterans. Save this info in your mind, and never forget it. It might save you a nervous breakdown. ...
  1. #1
    Just Joined! Lich's Avatar
    Join Date
    Feb 2008
    Posts
    30

    A word to Linux newbies.

    A note to those of you new to Linux, and even the veterans. Save this info in your mind, and never forget it. It might save you a nervous breakdown.

    When you are following online instructions or advice on how to do something in the terminal, be very, very, very careful about anything that removes a file or directory. This is the "rm" command, and can possibly be followed by the -r or -f or both, i.e., -fr

    Yesterday, I was following some instructions, and I was therein asked to remove a directory. I used the rm -fr command (which is to say I forced the deletion without confirmation and did it recursively so all files inside that directory were deleted too). I erred in the path of the directory, and lost quite a lot of very important, and system critical data. Although it's not impossible to recover it, the chances of success are virtually zero without very advanced knowledge of your system.

    So I spent most of my night recovering, needless to say. I was able to piece-meal everything back together from old CD's with data I had saved at one point, my flash drive, and the Ubuntu install CD. But it was a pain in the ass.

    Be very careful with your commands. Linux demands a certain amount of self accountability. I'm sure there are those out there who make some critical mistake in Linux and are turned off because of it, not realizing that in Linux-land, the system actually does what you tell it to...

  2. #2
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,142
    It absolutely sucks that you had to learn this the hard way. Glad you were able to get it fixed.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

  3. #3
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    2,940
    I must confess I usually man command_name or info command_name first before following instructions. That way I think I know what the results are going to be. (still has not saved me from some stupid mistakes!)

    There are plenty of commands which can result in major issues if not used carefully. Press the tab key twice in a terminal and you will be prompted something along the lines ...
    Code:
    Display all 1978 possibilities? (y or n)
    Trying to remember all options for all commands is not practical, I find the more I use linux the more I use the man and info commands!

    Being an ex-DOSer I did have a bad habit of trying command_name -h ... but after I got a shock with a command which ignored the -h and executed anyway I stopped doing that.

  4. #4
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,142
    Quote Originally Posted by Jonathan183 View Post
    I must confess I usually man command_name or info command_name first before following instructions. That way I think I know what the results are going to be. (still has not saved me from some stupid mistakes!)

    There are plenty of commands which can result in major issues if not used carefully. Press the tab key twice in a terminal and you will be prompted something along the lines ...
    Code:
    Display all 1978 possibilities? (y or n)
    Trying to remember all options for all commands is not practical, I find the more I use linux the more I use the man and info commands!

    Being an ex-DOSer I did have a bad habit of trying command_name -h ... but after I got a shock with a command which ignored the -h and executed anyway I stopped doing that.
    Try using another hyphen
    fdisk --h
    rm --h
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

  5. #5
    Just Joined!
    Join Date
    Feb 2008
    Posts
    0
    Great advice. And be careful at what you do as root - do user activities logged in as a normal user!

    Quote Originally Posted by Lich View Post
    A note to those of you new to Linux, and even the veterans. Save this info in your mind, and never forget it. It might save you a nervous breakdown.

    When you are following online instructions or advice on how to do something in the terminal, be very, very, very careful about anything that removes a file or directory. This is the "rm" command, and can possibly be followed by the -r or -f or both, i.e., -fr

    Yesterday, I was following some instructions, and I was therein asked to remove a directory. I used the rm -fr command (which is to say I forced the deletion without confirmation and did it recursively so all files inside that directory were deleted too). I erred in the path of the directory, and lost quite a lot of very important, and system critical data. Although it's not impossible to recover it, the chances of success are virtually zero without very advanced knowledge of your system.

    So I spent most of my night recovering, needless to say. I was able to piece-meal everything back together from old CD's with data I had saved at one point, my flash drive, and the Ubuntu install CD. But it was a pain in the ass.

    Be very careful with your commands. Linux demands a certain amount of self accountability. I'm sure there are those out there who make some critical mistake in Linux and are turned off because of it, not realizing that in Linux-land, the system actually does what you tell it to...

  6. #6
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,340
    Good advice.I also learnt the hardway when I was a Linux newbie. I intended to delete a file in /usr/local and entered something like " / usr/local/somepath". I realised my error within seconds but I had lost most of the commands in /bin so had to reinstall because I did not have a backup.

  7. #7
    Linux Enthusiast Manchunian's Avatar
    Join Date
    Dec 2007
    Location
    France but my heart stays in Britain
    Posts
    675
    Here's what could happen!
    Distribution: Archlinux
    Processor: 3 x Amd 64 bit
    Ram: 4 GB
    Graphics card: Nvidia GeForce 9800 GT

  8. #8
    Trusted Penguin Dapper Dan's Avatar
    Join Date
    Oct 2004
    Location
    The Sovereign State of South Carolina
    Posts
    4,562
    I think all of us have had mishaps at some point using the rm -rf command. I lost a whole directory myself once in the same way! Now, whenever using rm -rf, I stop and visually inspect the exact command for errors before pressing enter. Thanks for the informative and useful information. We all can stand reminding about these things from time to time.
    Linux Mint + IceWM Registered:#371367 New Members: click here

  9. #9
    Just Joined! fatra2's Avatar
    Join Date
    Mar 2005
    Location
    Switzerland
    Posts
    32
    do user activities logged in as a normal user!
    From my experience, this is the best way to prevent critical damage. I am talking about computing in every sense, and with every platforms. Whether you are using Linux, Mac, MSWindows or any other OS, you should never ever do normal work as root.

    I believe this is the best anti-virus on the market. If you don't have the administrator's rights, how can a virus get installed.

    Cheers

  10. #10
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,074
    Quote Originally Posted by surferb View Post
    do user activities logged in as a normal user!

    Indeed! I've made a fair amount of mistakes because I didn't follow this rule, and learned the right things the wrong way And I can't tell you how many times I have to help clean up a machine for friends or family because they won't use a regular profile for normal work. they just don't wanna take the minute or two to switch profiles/accounts.

    Oh well... What can ya do?
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.

Page 1 of 2 1 2 LastLast

Posting Permissions

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