When they say "Run rm -rf /*"

Поділитися
Вставка
  • Опубліковано 8 лют 2025
  • Make backups!
    To remove directory named '-f' use this: rm -r ./-f
    In this video Web User struggles to remove a Linux directory named -f. He asks for help on a Discord server. BIG CAT trolls him by telling to run the command, which remove all files on the computer. Web User did it and instantly regretted doing this. He asks hakcer for help, and he recovers his files using photorec tool. Hakcer looked through the recovered files and was kind of shoked.

КОМЕНТАРІ • 300

  • @Reavenk
    @Reavenk 2 роки тому +1132

    When Pixar was making ToyStory 2, legend has it that an errant command line wiped all of the movie assets and almost deleted the entire production of the movie. Then they realized a stay-at-home mom had a local backup at her house, and after restoring it they only lost 2 weeks of work instead of everything.

    • @Virbox
      @Virbox  2 роки тому +115

      Wow, I didn't know that

    • @cafebean
      @cafebean 2 роки тому +31

      only two weeks

    • @ViewerEm
      @ViewerEm 2 роки тому +64

      @@cafebean compared to everything though

    • @asdfssdfghgdfy5940
      @asdfssdfghgdfy5940 2 роки тому +63

      Wtf why wouldn't a studio of that size be running multiple NAS's

    • @Lin_The_Cat_
      @Lin_The_Cat_ 2 роки тому +95

      Yep! In one of the later Toy Story movies, there's a scene where a car has a license plate and the plate ID is 'rm -rf /'

  • @ΚωνσταντίνοςΟυρούμης

    If I had a coin for every time I have made a backup, I'd have zero coins.
    If I had a coin for every time I needed a backup, I'd have 5 coins 💀

    • @Virbox
      @Virbox  2 роки тому +59

      Haha true story 😄

    • @chinh4thepro
      @chinh4thepro 2 роки тому +2

      id have atleast 15

    • @wsketchy
      @wsketchy 2 роки тому +6

      t...timeshift....? timeshift anyone..?!

    • @그냥사람-e9f
      @그냥사람-e9f 2 роки тому +6

      If I had a penny for every time I made a backup, I'd have like 30
      If I had a penny for every time I needed a backup and were able to use one, I'd have 3 cent 🗿

    • @ΚωνσταντίνοςΟυρούμης
      @ΚωνσταντίνοςΟυρούμης 2 роки тому +1

      Black air force energy

  • @mathgeniuszach
    @mathgeniuszach 2 роки тому +340

    You could also just use "--".
    In other words: "rm -r -- -f"
    "--" tells the command parser to stop professing flags and treat everything else as arguments.

    • @PanDiaxik
      @PanDiaxik 2 роки тому +62

      Or rm ./-f

    • @zlorf_youtube
      @zlorf_youtube 2 роки тому +9

      Ohhh cool. Nice to know. Thanks

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 Рік тому +8

      All the quotation marks and backslashes make no difference because they are being interpreted by the shell, and this is not a shell problem: it’s a problem with the behaviour of the command itself, that (normally) every word beginning with “-” is treated as an option, not a filename.
      The “./” prefix works in this case because rm is looking for file names. It wouldn’t work with other commands where the arguments are not file names.
      This is why the “--” convention was introduced, and is respected by many commands: it says “everything after this is an argument of some kind, not an option”.

    • @pallas1634
      @pallas1634 Рік тому

      Or rm -r '-f', I thought that it worked because of (single quotes). Sorry.

    • @mathgeniuszach
      @mathgeniuszach Рік тому +3

      @@pallas1634 Unless you're using some strange version of Linux, that command does not work.

  • @john_swanson
    @john_swanson 2 роки тому +86

    change the world my final message goodbye

  • @сосковыйёрж
    @сосковыйёрж 2 роки тому +258

    The thing is... If you do backups and the disk where the backups are stored is still mounted, sudo rm -rf /* gonna delete it too💀

    • @rotteegher39
      @rotteegher39 2 роки тому +9

      btrfs subvolumes are separtare from what is mounted and you can't delete them even with rm -rf

    • @erikkeever3504
      @erikkeever3504 2 роки тому +11

      3-2-1: three copies total (including working), in two locations, one of which is off site.

    • @ruslansanzharov5825
      @ruslansanzharov5825 Рік тому +9

      Normally backups are mounted in read-only mode to prevent abuses like this

    • @josephwhittaker2065
      @josephwhittaker2065 7 місяців тому +2

      Offsite backups ftw

    • @Tryh4rd3rr
      @Tryh4rd3rr 6 місяців тому

      @@erikkeever3504no, 1 other one is another format. Like 2 ssds and 1 hard drive etc.

  • @someonestolemyname
    @someonestolemyname 2 роки тому +290

    Things you shouldn't do
    - run shell as root
    - running stranger's code without checking what it does especially as root
    - not backing up your data
    - using rm without safeguard especially with -r and -f flags
    - not using gio trash, trashcli or other trash utilities which you can recover from

    • @mrbanana6464
      @mrbanana6464 2 роки тому +13

      Interactive flags for rm gives you alarm fatigue and makes you less likely to double check what you’re deleting

    • @ChimeraX0401
      @ChimeraX0401 2 роки тому +5

      and not making snapshots so that you can just revert back when you broke your system

    • @zackattack9228
      @zackattack9228 2 роки тому

      I am broke bro, I can't do backups

    • @sleaf6
      @sleaf6 2 роки тому

      I do all but one of these things

    • @character640p
      @character640p 2 роки тому

      @@zackattack9228 Use Rar and telegram bro

  • @blank001
    @blank001 2 роки тому +105

    You should always take your PC's backup and store it on the same PC it saves a lot of space
    Source: trust me brah

    • @louiesatterwhite3885
      @louiesatterwhite3885 2 роки тому

      At least store it on a different drive than your system drive 💀

    • @user-xn3kt6bn5r
      @user-xn3kt6bn5r 2 роки тому +4

      @@louiesatterwhite3885 nah brah just make new partition. Save loads of $$

  • @devrim-oguz
    @devrim-oguz 2 роки тому +52

    The trash disappearing got me 😂

    • @link_team3855
      @link_team3855 7 місяців тому +1

      HE DELETED THE TRASH BIN! AAAAAAA

    • @private895
      @private895 5 місяців тому

      A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN A BIN IN A BIN .

  • @aya-hl5bk
    @aya-hl5bk 2 роки тому +84

    "Ok, lemme just LiveCD in" Funniest thing here

    • @godnyx117
      @godnyx117 Рік тому

      *Cringest

    • @WolfyRed
      @WolfyRed Рік тому

      @@godnyx117what?

    • @godnyx117
      @godnyx117 Рік тому

      @@WolfyRed Did I stutter?

    • @WolfyRed
      @WolfyRed Рік тому

      @@godnyx117 Fym? What is cringe about LiveCD

    • @godnyx117
      @godnyx117 Рік тому

      @@WolfyRed Do you have a time machine?

  • @godnyx117
    @godnyx117 Рік тому +31

    The first part, gave me PTSD!!!! I once had a file in my home directory called "~".
    GUESS what command I run to remove it!!!

    • @te4enie_donnyx_trav
      @te4enie_donnyx_trav 11 місяців тому +3

      Damn😂😂

    • @yusinwu
      @yusinwu 6 місяців тому +9

      Self-initiated homelessfication protocol

    • @lukasjetu9776
      @lukasjetu9776 3 місяці тому

      as a non bash user... please show me what command did you run

    • @godnyx117
      @godnyx117 3 місяці тому

      @@lukasjetu9776 I was inside my home directory and I run: `rm ~`

    • @lukasjetu9776
      @lukasjetu9776 3 місяці тому

      @@godnyx117 what all did it delete?

  • @callisoncaffrey
    @callisoncaffrey 2 роки тому +74

    The guy didn't like. The -f folder was gone, wasn't it?
    Edit: I meant "didn't lie" obviously.

    • @callisoncaffrey
      @callisoncaffrey Рік тому +1

      @@monad_tcp I'm not. I'm using OpenBSD. Also you know there are other distros than suicide linux, right?

    • @WolfyRed
      @WolfyRed Рік тому

      @@callisoncaffreywhat Tf is "suicide Linux"?

    • @callisoncaffrey
      @callisoncaffrey Рік тому

      @@WolfyRed You type one command wrong and it deletes your hard drive. Can't recommend.

    • @fltfathin
      @fltfathin 5 місяців тому

      @@callisoncaffrey same thing can happen in windows, there's a reason why there is administrator's code of conduct.

    • @callisoncaffrey
      @callisoncaffrey 5 місяців тому

      @@fltfathin What? Please state what you impression of me is.

  • @ihavenoideadanny
    @ihavenoideadanny 2 місяці тому +3

    this is a rm -rf "$STEAMROOT/"* type of moment

  • @Vienna3080
    @Vienna3080 Рік тому +7

    He debloating Ubuntu

  • @filipsr4452
    @filipsr4452 2 роки тому +48

    rtfm :)
    POSIX.1-2008, volume "Base Definitions", section 12.1 "Utility Syntax Guidelines", item number 10: "The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character."

    • @Virbox
      @Virbox  2 роки тому +13

      bbut not all utilities are POSIX-compliant 🤓 (although GNU coreutils are)

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 Рік тому +1

      I wrote a generic packup-blend utility to pack up a Blender document and automatically include its external dependencies in a single archive, with support for tar, zip and 7z formats. Of the three, only the zip command did not recognize “--” in any form.

    • @fltfathin
      @fltfathin 5 місяців тому

      if it were me i'd rename/ move that folder then delete it. guy was playing with fire to begin with

  • @horsepowermultimedia
    @horsepowermultimedia Рік тому +20

    Sudo rm -rf /* is the System32 deletion of Linux.

    • @_kitaes_
      @_kitaes_ 6 місяців тому +4

      more like deletion of / (hidden root folder in windows) that includes all partitions

    • @fluoriteByte
      @fluoriteByte 4 місяці тому +2

      Its more like deleting the the whole C drive and all other drives that are attached

  • @SodalisUK
    @SodalisUK 6 місяців тому +5

    I actually had this happen on a real production IT system that I was working towards taking over the management of. I was working for an outsourcing company, and the system was in production and being operated and managed by the application vendor.
    The reason we hadn't taken it over was because there was zero operational documentation and zero scripted operations. So the vendor was operating it manually based on instructions scribbled on a scrap of paper.
    These instructions said: 1. "cd /tmp"; 2. "rm -yr *"; 3. "reboot".
    Unfortunately, one evening having done step one, the operator received a telephone support call and as part of answering that he went root (presumably with "sudo -i" which put him back in the root directory). When he finished the call he executed steps 2 and 3 without exiting root thus doing EXACTLY what this video shows.
    D'UH!!!
    To cap it all, it then turned out that the system backups hadn't been working either and hadn't been tested and it took them 2 or 3 weeks to rebuild this production system. DOUBLE D'UH!!!!!!
    I might add that this was one of two similar screw ups (the other resulting from deletion of the production SQL database) at the end of a disastrous fixed price application development where the system has already been rejected and redeveloped from scratch and where the initial go live was abandoned twice, once because an untested system timezone change caused it to fail, and once because the system has never been tested on a production sized database, and several missing indexes resulted in use response times on a linked production customer call healing system going from 1sec to over 30mins.
    Put simply a fiasco from start to finish from a MAJOR MAJOR software house.

  • @AgentPothead
    @AgentPothead 2 роки тому +6

    LMAO that Ducktales moon theme song hit out of no where.

  • @martinhorner642
    @martinhorner642 2 роки тому +8

    I didn't believe it was that hard to quote '-f' to rm as it was shown in the video. So I wrote a program to create an actual '-f'. Now I have to rm -rf /*

    • @GSBarlev
      @GSBarlev 2 роки тому

      I can't believe I'm saying this, but can't you just open a GUI file explorer and delete it from there?
      This actually happened to me a few weeks ago, but it was ".." and not "-f"
      My solution was to use python pathlib:
      >>> from pathlib import Path
      >>> files = Path(".").glob("*")
      (eyeball to identify the cursed file)
      >>> cursed_file.unlink()

    • @sylv512
      @sylv512 Рік тому +1

      all you have to do is “rm -rf -- '-f'”

  • @etaashmathamsetty7399
    @etaashmathamsetty7399 2 роки тому +24

    Finally beluga but it's a Linux channel
    U deserve more subs

    • @LinuxPlayer9
      @LinuxPlayer9 2 роки тому +1

      That's what my brother has been saying

  • @govindsanal3092
    @govindsanal3092 2 роки тому +4

    That’s one way to take out the trash

  • @andreasjoannai6441
    @andreasjoannai6441 4 місяці тому +1

    Me: Sees rm -rf knowing that's the linux equivalent of del
    Also me: Noticing it ends in /*
    In other words, running rm -rf /* deletes every system-accessible file and folder, bricking the OS.

  • @BurzowySzczurek
    @BurzowySzczurek Рік тому +1

    Nice Beluga style video. Keep going!

  • @sofiaknyazeva
    @sofiaknyazeva 2 роки тому +1

    --no-preserve-root has left the chat

  • @directx872
    @directx872 2 роки тому +1

    rm -rf /* removes EVERYTHING so you effectively brick your system.

    • @directx872
      @directx872 2 роки тому

      @@parkman29 want to test your luck?

    • @electric7487
      @electric7487 Рік тому

      In 2016, on some machines with SystemD and UEFI, running "rm -rf /" or "rm -rf /*" could permanently hard-brick your machine since the filesystem containing the EFI firmware's configuration files, located at /sys/firmware/efi/efivars, was mounted read/write. They fixed this in 2017 by mounting them read-only.

  • @3ndgamer28
    @3ndgamer28 2 роки тому

    this command was run when toy story 2 was still being made but then some employee that worked there and had a backup of the files and everything was fine

  • @rea9lizer
    @rea9lizer 2 роки тому

    It has been decades but Take off and land still gets me

  • @project_speedy_addiction
    @project_speedy_addiction 3 місяці тому

    That " /* " makes all the difference in the system.
    So, wake up, Arch user, wake up and smell the upgrade bork.

  • @zitrax506
    @zitrax506 2 роки тому +10

    it's blatantly realistic, great video 🐧🖤

  • @Geitungur
    @Geitungur Рік тому

    That bit at the end reminded me of a story I heard where some serial killer took his laptop to a PC shop because it broke and when they fixed it it turned on to his desktop. With a bunch of photos of his victims. :|

  • @SNSISNSJISEJSJS
    @SNSISNSJISEJSJS Рік тому +2

    And that's the moment that he remembered that he have fucked up 💀

    • @sylv512
      @sylv512 Рік тому

      are you referencing the homework folder 💀

    • @SNSISNSJISEJSJS
      @SNSISNSJISEJSJS 6 місяців тому

      🤣🤣💀💀​@@sylv512

  • @randomname2437
    @randomname2437 2 роки тому +3

    Bless photorec

  • @Sh0071n6
    @Sh0071n6 6 місяців тому

    The first thing the noob at the terminal does = "sudo rm -rf /*"

  • @UltraNyan
    @UltraNyan 2 роки тому

    Photorec - vomits all your files into a big pile

  • @spaceowl5957
    @spaceowl5957 2 роки тому +1

    This was so emotional and inspirational

  • @georgewang5516
    @georgewang5516 2 роки тому +3

    Thanks! Your video content is the safest and most useful

  • @KnakuanaRka
    @KnakuanaRka 22 дні тому +1

    I don’t know how fricked in the head you have to be to say something like that that could destroy a bunch of someone’s valuable and personal data as a joke. How is that funny?

  • @pam4962
    @pam4962 Рік тому +1

    I really, really thought that I was watching Beluga for a sec lol

    • @aarnealplayzgames9580
      @aarnealplayzgames9580 5 місяців тому

      I wanted to sub to some random due who had no content and found you, gongrats… I guess?

  • @swindle-t3m
    @swindle-t3m 10 місяців тому

    my will to live when I started middle school

  • @markusTegelane
    @markusTegelane 2 місяці тому

    To be fair, this will eventually remove the `-f` directory

  • @FeinesFabi
    @FeinesFabi 2 роки тому +14

    Send them this instead so they (most likely) cannot recover their data: 'dd if=/dev/random of=/dev/sda bs=4096'

    • @Virbox
      @Virbox  2 роки тому +5

      a real villain 😈

    • @Noob-gb6bn
      @Noob-gb6bn Рік тому

      What does this do?

    • @electric7487
      @electric7487 Рік тому +1

      ​@@Noob-gb6bn It corrupts your disk with random gibberish.

    • @Noob-gb6bn
      @Noob-gb6bn Рік тому

      @@electric7487 aight thx, but how?

    • @electric7487
      @electric7487 Рік тому

      @@Noob-gb6bn /dev/random outputs random when it's called. The "if" stands for Input File, and "if=/dev/random" means you're using /dev/random as the source of the data to be written. "of" stands for Output File, and "of=/dev/sda" means that the data is to be written to /dev/sda. If /dev/sda is the location of your hard drive's main partition, you will corrupt your install and will force a format and reinstallation.
      An alternative is "dd if=/dev/zero of=/dev/sda", which overwrites /dev/sda with zeros instead of random data.

  • @dadudeme
    @dadudeme Рік тому

    I am familiar with this procedure. It is a pain to recover a whole windows system after writing rasbian over the first 2 gigs.

  • @chri-k
    @chri-k 2 роки тому +7

    would it be logical for rm -rf /.. to disintegrate everything connected to the system bus?

  • @retzerR
    @retzerR 2 роки тому

    I made a directory called -f, fix 2 ways
    1. GUI
    2. rm ./-f -r (without r it will complain about not being a file)

  • @Iceozi
    @Iceozi 2 місяці тому

    Tip: Whenever running a Linux command, make sure to make a backup before doing it!

  • @oneandonly_h4
    @oneandonly_h4 2 роки тому +3

    Oh man I had that problem when I was first starting with Linux.

  • @edwolt
    @edwolt 2 роки тому

    Today I started running "rm -r /home" as root, I stopped it as soon as I see the mistake. I hope no important file was lost.

  • @BloomDevelop
    @BloomDevelop 5 місяців тому

    Oh shit I remember that when I did this exact command on a container on a wsl (before I moved to Linux) and it deleted the whole wsl but at the cost of apps shortcuts vanished.

  • @dtkedtyjrtyj
    @dtkedtyjrtyj 2 роки тому +12

    rm -- -f
    might work
    But I suspect it wont format in UA-cam.

    • @Virbox
      @Virbox  2 роки тому +1

      This is also correct

  • @ridndev_
    @ridndev_ 6 місяців тому

    i once used multiflasher or whatever it is called and flashed my data backup instead of my USB drive
    100 gb of "projects" down the drain

  • @anywallsocket
    @anywallsocket 2 роки тому +1

    Yfw you run >rm file * instead of >rm file* 💀

  • @danielbelmir0
    @danielbelmir0 2 роки тому +1

    i'm using git a lot for my projects, i know i'm the only that uses my programs but that's still a lot of work so it's good to have repositories on the internet to backup and be able to clone and push changes from any computer.

    • @GSBarlev
      @GSBarlev 2 роки тому +2

      You'd also be surprised at who is benefiting from your code being out there. I've gotten into Minecraft modding, and there is *zero* documentation for anything, especially when a new version's just been released and you're trying to stay compatible. Oftentimes I'll search github for an import of the specific class I'm needing to reference and learn the proper usage pattern from a random mod with twenty downloads.

  • @barneytf2
    @barneytf2 Рік тому

    Beluga, but he uses Linux. And I like it

  • @qaax00
    @qaax00 Рік тому

    i did that in my archiso and its boomed

  • @yeshwantkota230
    @yeshwantkota230 6 місяців тому

    Tha one windows user: Wait, my os is giving me errors

  • @commandcracker42
    @commandcracker42 6 місяців тому

    Use btrfs and you can run rm -rf /* any time you want

  • @TheRealJuangela
    @TheRealJuangela 2 роки тому

    Everyone who watches Toy Story 2 will remember this

  • @TheGoblinoid666
    @TheGoblinoid666 2 роки тому

    Once I had to do this to remove a kally linux instalation, and it worked.

  • @ZE_R0GT
    @ZE_R0GT 6 місяців тому +1

    this seems like a beluga clone

  • @RareScrap
    @RareScrap Рік тому

    What a good ending!

  • @butlazgazempropan-butan11k87
    @butlazgazempropan-butan11k87 4 місяці тому

    Its the "alt + f4" of linux

  • @toster9960
    @toster9960 6 місяців тому

    you could just rm -r -- -f

  • @KangJangkrik
    @KangJangkrik 6 місяців тому

    Just like PDN admins, except they won't bother to restore

  • @Bob-bl1ey
    @Bob-bl1ey 5 місяців тому

    You don't have to type sudo, if u r already logged in as root

  • @पिज्जा
    @पिज्जा 6 місяців тому

    The more terrible thing is mess up if and of in data duplicate command

  • @Plumjet09
    @Plumjet09 6 місяців тому

    Technically it did delete it

  • @nikoszervo
    @nikoszervo 2 роки тому

    I dont make backups, I upload everything on the internet!

  • @Adam_Lyskawa
    @Adam_Lyskawa 2 роки тому +9

    When you use clouds, you don't really need big backups. BTW, files you own end up owning you.

    • @character640p
      @character640p 2 роки тому

      Bro, what clouds do you use?

    • @nothanks5531
      @nothanks5531 2 роки тому +1

      @@character640p guava ice geekbar

    • @character640p
      @character640p 2 роки тому

      @@nothanks5531 what does it even mean?

  • @naaaaaaaaathan
    @naaaaaaaaathan 4 місяці тому

    rm -rf "-f" and you made it

  • @supercellodude
    @supercellodude 2 роки тому

    I wonder how many normal distros (using glibc and most programs dynamically linked) try to have at least statically linked core utilities like rm.
    'cuz, you know, once you delete glibc*.so*, rm might not be able to run anyways, but much of the system data would already be deleted

    • @monad_tcp
      @monad_tcp Рік тому

      It's always able to run, because this is Linux, it memory maps the file then delete the reference to the inode and keep the inode until the program closes.
      Unlike windows, that will lazy load the executable and keep it both locked in the file system and memory mapped. The file system could technically unlink the record on the MIB, and keep the blocks loaded and memory mapped, so you can actually delete the file, but that's not how the DLL loader works. Which is incidentally why the system has to reboot for some updates, most of them are able to just be service restarts, but when it's kernel mode, they can't.
      You can close the file handles and delete things, which is even cool, as it's like pulling the rug from under the process, the process crashes after you delete the file, easy trick.
      I use it all the time, close the handles using process hacker and then delete files and watch programs cry and commit suppuku because their file handles became null. (some are able to deal with it, Explorer is one, which is good as it sometimes keep handles dangling locked)

  • @gdplayer1035
    @gdplayer1035 11 місяців тому

    windows user moving to linux

  • @hairynamjari790
    @hairynamjari790 2 роки тому

    Just run
    rm -r -- -r

  • @rotteegher39
    @rotteegher39 2 роки тому

    That's why I use btrfs or zfs

  • @polocatfan
    @polocatfan 7 місяців тому +1

    situation like this happened to me in a discord server. there was an issue going on with a library and they recommended I manually upgraded it. When I did that my system got bricked and when I told them they acted like they never recommended it and told me off. Turns out they got incredibly pissed off that I reported a bug in their "PERFECT PROGRAM" or thought I was lying so they decided to "prank" me so they intentionally sabotaged my machine. Told them to go fuck themselves and right before I left I saw a message that basically said "oops you were right...". fuck that nonsense. fuck all linux developers.

    • @seekyboi23
      @seekyboi23 6 місяців тому

      guild* 🤓🤓🤓

  • @alfaalfa993
    @alfaalfa993 2 роки тому +4

    Why does he keep so many low-res photos?

    • @sylv512
      @sylv512 Рік тому

      that’s his homework folder
      always protect your homework folder

  • @EmoonX
    @EmoonX 2 роки тому +1

    "[~user/]$ rm -rf /
    rm: it is dangerous to operate recursively on `/'
    rm: use --no-preserve-root to override this failsafe"
    At least they're nice about offering a second chance.

  • @kokodi01
    @kokodi01 6 місяців тому

    silly little me did sudo chmod /* 000, worst mistake of my life.

  • @ch4n4o2
    @ch4n4o2 Рік тому

    Who needs backups if you can just reinstall the system

  • @ЛордКекер
    @ЛордКекер 3 місяці тому

    he said '-r -f', no '-rf'

  • @m4rt_
    @m4rt_ 2 роки тому

    no
    rm -r -f /* --no-preserve-root

  • @NoobDeSupreme
    @NoobDeSupreme 2 роки тому +8

    HAHAHA This is so true XD.

  • @natywubet2175
    @natywubet2175 Рік тому

    rm is depreciated, use shred instead

  • @colour_bloo
    @colour_bloo Рік тому

    Nooooooo - not LMMS...
    It's going to take forever to re-install all those plugins 😢

  • @Maruchipawa
    @Maruchipawa 6 місяців тому

    I have absoultly no idea wth this is about

  • @Paddy_1245
    @Paddy_1245 5 місяців тому

    Yea I ran it before in cmd and it broke my computer gpedit and regedit all gone😢

  • @philosophicalgamer2564
    @philosophicalgamer2564 2 роки тому

    This should be an amine

  • @Lucas-ky7dc
    @Lucas-ky7dc 2 роки тому +3

    Wait, `rm -r \-f` wouldn't work?
    Well, guess I need to test that myself.

    • @jakdziala
      @jakdziala 2 роки тому +2

      I guess it's maybe because of the backslash, linux uses the forward ones
      upd: yep, he wrote that in the description

    • @chri-k
      @chri-k 2 роки тому

      @Watcher no, you escape the character “-“, which yields “-“, and so that backslash does absolutely nothing

  • @yuvalid4156
    @yuvalid4156 2 роки тому +3

    How would you delete a folder named -f? Genuinely asking

    • @Virbox
      @Virbox  2 роки тому +12

      Two options:
      1) rm -r ./-f
      2) rm -r -- -f

    • @warmike
      @warmike 2 роки тому +2

      @@Virbox or you know just use the gui

    • @coffeedude
      @coffeedude 2 роки тому +3

      @@warmike you can't if you are ssh-ing into a server

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 Рік тому +1

      Pro tip: if you are deleting a directory you know/expect to be empty, use “rmdir”, not “rm -rf”. Because “rmdir” will fail with an error if in fact the directory is not empty.

  • @mustangrt8866
    @mustangrt8866 Рік тому

    just cp lib and src, rm rf the projects and make new projects folder

  • @leo_craft1
    @leo_craft1 5 місяців тому

    Just rm "-f"

  • @Pwnagotchi-0
    @Pwnagotchi-0 11 місяців тому

    I could learn something from you guys

  • @caiolaytynher5994
    @caiolaytynher5994 2 роки тому

    Fun fact: I already deleted my home folder doing this

    • @edwolt
      @edwolt 2 роки тому +1

      I almost did it today. I ran the command "rm -r /home" as root trying to delete another folder, I stopped it as soon I saw the mistake. I hope that I didn't lost any important file.

    • @caiolaytynher5994
      @caiolaytynher5994 2 роки тому

      @@edwolt in my case was a mistake with environment variables, I had a folder named $HOME (long history), tried to delete it and boom. What saved me was the protected files, I kept all the important things, but other stuff did got deleted, hehe.

  • @matthewlui1004
    @matthewlui1004 2 роки тому

    A permission error you say, why not do
    sudo chown -R /

    • @electric7487
      @electric7487 Рік тому

      I actually did that once back when I was still using my old laptop. I was trying to install something and it threw lots of "permission denied" errors. Since I didn't know much about the Linux filesystem and file permissions at the time, I foolishly ran "sudo chown [username] -R /*" in an attempt to "fix it". The result? sudo isn't working anymore ("sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set"), even pkexec errors out ("pkexec: must be setuid root"), and a lot of other programs throw errors. When I tried to reboot my system it would always hang before getting to the login screen.
      Turns out that sudo, ssh, sendmail, pkexec, the login binary, and many other applications require filesystem permissions checks in order to run safely since they would open up too many security holes otherwise. When I ran "chown" on my entire root directory, it compromised everything.
      The worst part about running any sort of chmod or chown recursively is that it's lossy and irreversible by nature, and doing on the root directory is especially dangerous. I ended up making a backup of my data and reinstalling Ubuntu over my home folder since it was too much hassle reverting everything back.

  • @methanbreather
    @methanbreather 2 роки тому

    you know - if your file system supports snapshots, it isnt that bad....

  • @AnimeZNT_15
    @AnimeZNT_15 5 місяців тому

    Nahh bro just told him to delete all files in root directory

  • @devtadeo
    @devtadeo 2 роки тому +1

    For those who don't know u have tu use a string notation so -f is '-f' | "-f" bc if u just dont use it the command will take it as a flag

    • @chri-k
      @chri-k 2 роки тому +1

      there is nothing distinguishing a flag from an argument, a flag is just an argument that is treated differently.
      for both rm -r -f and rm -r “f”
      rm will see the arguments as [“-r”, “-f”]
      what the string notation does is allow to include whitespaces in the argument.
      the correct command ( youtube’s markup thing interferes ) would be rm -r -- -f
      the argument “--“ should according to POSIX be taken to mean “everything that comes after this is not a flag”, and rm does indeed do so.

  • @WaxxyStick
    @WaxxyStick 6 місяців тому

    not another baluga

  • @Viktor-w5r4k
    @Viktor-w5r4k 2 місяці тому

    rm \-r

  • @Lucky97566
    @Lucky97566 5 місяців тому

    Put it in ""

  • @InfiniteCoder01
    @InfiniteCoder01 2 роки тому

    Actually you need "rm -rf /* --no-preserve-root"

    • @sylv512
      @sylv512 Рік тому

      distro-dependent, i think

  • @StrivingArrow
    @StrivingArrow Рік тому +1

    How do I restore the files?

    • @electric7487
      @electric7487 10 місяців тому

      From your daily backup, of course.