Results 1 to 4 of 4

Thread: hard lesson learned using CLI blindly

  1. #1
    Join Date
    Jun 2020
    Beans
    183

    hard lesson learned using CLI blindly

    thought i'd share the danger of running commands that you not sure of what it actually does .
    so the other day i installed protonvpn via this site ,played around with it for a bit and found it didn't suit my needs .
    uninstalled it with the commands found on same fore mentioned site, only i made a typing error (long story why i didn't copy paste) and inserted a space between ~/ and .directory
    command i'm talking about is
    Code:
    rm -rf ~/.cache/protonvpn
    the space , together with the -rf command,as i later learned , means it will force remove your home (~/) directory and then the .cache/protonvpn files.
    be careful when using -rf ,actually, never use it lol
    lucky for me i had my home directory backed up ,so did a clean install and was back to normal in no time.
    PS. btw , i tried restoring with timeshift , then realised my "home" is not included in timeshift's settings.

    moral of the story , a simple space inserted where it shouldn't be,could wipe your system

    Last edited by 3nd; March 27th, 2021 at 09:06 PM.
    xubuntu 20.04.2 LTS (focal fossa)

  2. #2
    Join Date
    Oct 2004
    Location
    Albuquerque New Mexico, U
    Beans
    1,156
    Distro
    Ubuntu Development Release

    Re: hard lesson learned using CLI blindly

    Actually, the moral of this story is there is no substitute for testing and validating your backup scheme before you need it.

    You got lucky in that you had an alternative backup of /home. Otherwise, you would have been in trouble because you assumed Timeshift was doing something it was not (and does not by developer's intent). A test restore of a Timeshift backup would have made the issue obvious.

    Your initial mistake was one anybody could have made. It's easy, especially when working on a tablet or smaller laptop, to miss an inadvertent space character in a command string. Gnu himself knows I done it many times...and worse. An effective and tested backup is all that keeps anyone from turning a simple typing error into a significant disruption of one's day, or worse. Your experience is a timely reminder that little things can lead to big problems and can happen to anyone, at any time, and in any circumstance.

    TheFu has written volumes here about backup. If you're really interested in what's required for an effective backup strategy it is worth the time to search out some of his more recent posts on the subject and spend some time with them.
    regards

  3. #3
    Join Date
    Nov 2009
    Beans
    Hidden!
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: hard lesson learned using CLI blindly

    best is:
    are you sure?
    Y
    prompt:_

    wait... never mind, it's done.
    Read the easy to understand, lots of pics Ubuntu manual.
    Do i need antivirus/firewall in linux?
    Full disk backup (newer kernel -> suitable for newer PC): Clonezilla
    User friendly full disk backup: Rescuezilla

  4. #4
    Join Date
    May 2006
    Location
    Switzerland
    Beans
    2,654
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: hard lesson learned using CLI blindly

    When I was a newbie back in 1996 (long time ago, LOL) I wanted to wipe all my "dot" config files (stuff like ".bashrc", ".profile", ".vim" and so on) ... So I typed in this *DANGEROUS* command:
    Code:
    rm -rf .*
    DO NOT TRY THIS!!

    What I did not consider: The directories one level up ".." are included in a ".*" wildcard construct.

    And I was "root" at that time....

    Things I learned that day:

    • NEVER EVER work as "root" unless you REALLY need to and YOU KNOW EXACTLY what you are doing...
    • don't use wildcards ("*") if you don't really have to, you might accidentally affect waaaaay more files than you actually wanted...
    • "rm" is really really fast at deleting stuff
    • Any backup is only as good as its working restore procedure ...


    Long story short: Everyone here has messed up at some point. Consider it being part of the initiation ritual
    Last edited by Frogs Hair; 4 Weeks Ago at 05:05 PM. Reason: language

Bookmarks

Posting Permissions

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