I’m working on a some materials for a class wherein I’ll be teaching some young, wide-eyed Windows nerds about Linux and we’re including a section we’re calling “foot guns”. Basically it’s ways you might shoot yourself in the foot while meddling with your newfound Linux powers.

I’ve got the usual forgetting the . in lines like this:

$ rm -rf ./bin

As well as a bunch of other fun stories like that one time I mounted my Linux home folder into my Windows machine, forgot I did that, then deleted a parent folder.

You know, the war stories.

Tell me yours. I wanna share your mistakes so that they can learn from them.

Fun (?) side note: somehow, my entire ${HOME}/projects folder has been deleted like… just now, and I have no idea how it happened. I may have a terrible new story to add if I figure it out.

  • unalivejoy
    link
    fedilink
    English
    151 year ago

    I once removed all groups from my user by using usermod -g instead of usermod -G

  • @thezeesystem@lemmy.world
    link
    fedilink
    English
    111 year ago

    Reformatted windows and installed Linux.

    Wait before the hate. This was the first time I did it and knew nothing about it and didn’t know it would wipe my system. So I lost everything.

  • @HarriPotero@lemmy.world
    link
    fedilink
    141 year ago

    Not me, and not Linux, but a school mate found the following bash snippet online :(){ :|:& };:.

    Naturally, he tried it on the SunOS servers we had access to for schoolwork. He got his account suspended for the rest of the year.

    I think most Linux distros are configured to kill fork bombs nowadays.

  • @bigmclargehuge@lemmy.world
    link
    fedilink
    8
    edit-2
    1 year ago

    My biggest thing when switching to Linux was understanding why I didn’t have permission to alter half of my file structure. I was trying to take ownership of my /usr directory as a user and had to have multiple people explain why that was a bad idea (and why simply making any changes as a super user via terminal was more than adequate for the results I wanted).

    My mindset was a result of so many user files being spread across dozens of branches of the Windows file structure. Some very close to the root of the drive, some a few directories deeper. I didn’t really understand the benefit of having all my stuff in /home (and am now a full convert. Just thinking about navigating a Windows drive makes my skin crawl now).

  • Fushuan [he/him]
    link
    fedilink
    English
    131 year ago

    “I have 200 GB of unused space in the windows partition, I’ll just plug a live CD, divide that partition and merge it with the Linux one, ggez”

    Yes, dividing the windows partition destroyed it. Yes, mixing the windows and ext destroyed Linux. I might have been able to recover something but I was like 18 and I just reinstalled windows in a fit of misdirected anger against Linux.

  • Laura
    link
    fedilink
    131 year ago

    dd if=/dev/zero of=/dev/sda status=progress

    hmm why is it so fast

    OH

    CTRL-C

    and then a kernel panic yeah my fs was gone

  • @collapse_already@lemmy.ml
    link
    fedilink
    English
    91 year ago

    I do dumb things like edit my network configuration do some stuff and log out. Then I can’t login the next weekend because the IP address is wrong. Also:

    Ifconfig eth0 down

    And I am booted from ssh.

    • @ProtonBadger@lemmy.ca
      link
      fedilink
      2
      edit-2
      1 year ago

      Yeah screwing with the network interface of the machine you’re SSHd into is something nearly every sysadmin have done at least once.

      That or changing something, rebooting the server and subsequently being unable to contact it again due to said change. I’m always scared and feeling I’m taking a risk when upgrading a major OS version over SSH, yet Ubuntu never failed me in that, it’s the silly things that got me, like messing with fstab.

  • @deo@lemmy.dbzer0.com
    link
    fedilink
    131 year ago

    Due to some poorly placed quotes, I managed to create a subdirectory named ~ in my home folder. You can imagine what happened next. Luckily, I had just gotten my backup system up and running the day before, so nothing was lost.

  • i accidentally mark iwd as dependency rather than explicit. after that someday im removing a package depends on iwd, iwd itself been removed as a dependency as well. and im been blocked out of my remote machine until someday i have physical acces to it

  • @akash_rawal@lemmy.world
    link
    fedilink
    111 year ago

    How I lost a Postgres database:

    1. Installed Postgres container without configuring a volume
    2. Made a mental note that I need to configure a volume
    3. After a few days of usage, restarted the container to configure the volume
    4. Acceptance
    • @flubba86@lemmy.world
      link
      fedilink
      3
      edit-2
      1 year ago

      Well, that’s a dumb Docker thing, not necessarily a dumb Linux mistake. You could’ve made the same mistake on Windows or MacOS when running Docker.

      • @akash_rawal@lemmy.world
        link
        fedilink
        31 year ago

        Technically, containers always run in Linux. (Even on windows/OS X; on those platforms docker runs a lightweight Linux VM that then runs your containers.)

        And I wasn’t even using Docker.

  • @jyte@lemmy.world
    link
    fedilink
    11
    edit-2
    1 year ago
    • apt something that ended up removing sudo. No more admin rights.
    • used rsync to backup pretty much everything in / , with remove source option…
    • find with -delete option miss positioned. It deleted stuff before finding matching pattern
    • chown / chmod on /bin and/or /usr/bin
    • Removed everything in /etc
  • @jdnewmil@lemmy.ca
    link
    fedilink
    91 year ago

    Using sudo when it isn’t necessary, and the real cannon: sudo su… Adding sudo to your command lines indiscriminately causes files you create to be owned by root even though they are in your home directory, and then you end up using sudo to make changes to the files… and then the filesystem permissions cannot prevent you from successfully running an accidental “sudo rm -rf /” command.

    Seriously… sudo is not a “habit” to develop in order to avoid dealing with filesystem permissions problems.