When they say "Run rm -rf /*"
HTML-код
- Опубликовано: 15 ноя 2024
- 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.
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.
Wow, I didn't know that
only two weeks
@@cafebean compared to everything though
Wtf why wouldn't a studio of that size be running multiple NAS's
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 💀
Haha true story 😄
id have atleast 15
t...timeshift....? timeshift anyone..?!
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 🗿
Black air force energy
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.
Or rm ./-f
Ohhh cool. Nice to know. Thanks
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”.
Or rm -r '-f', I thought that it worked because of (single quotes). Sorry.
@@pallas1634 Unless you're using some strange version of Linux, that command does not work.
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
Interactive flags for rm gives you alarm fatigue and makes you less likely to double check what you’re deleting
and not making snapshots so that you can just revert back when you broke your system
I am broke bro, I can't do backups
I do all but one of these things
@@zackattack9228 Use Rar and telegram bro
change the world my final message goodbye
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💀
btrfs subvolumes are separtare from what is mounted and you can't delete them even with rm -rf
3-2-1: three copies total (including working), in two locations, one of which is off site.
Normally backups are mounted in read-only mode to prevent abuses like this
Offsite backups ftw
@@erikkeever3504no, 1 other one is another format. Like 2 ssds and 1 hard drive etc.
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
At least store it on a different drive than your system drive 💀
@@louiesatterwhite3885 nah brah just make new partition. Save loads of $$
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."
bbut not all utilities are POSIX-compliant 🤓 (although GNU coreutils are)
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.
if it were me i'd rename/ move that folder then delete it. guy was playing with fire to begin with
The trash disappearing got me 😂
HE DELETED THE TRASH BIN! AAAAAAA
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 .
He debloating Ubuntu
"Ok, lemme just LiveCD in" Funniest thing here
*Cringest
@@godnyx117what?
@@WolfyRed Did I stutter?
@@godnyx117 Fym? What is cringe about LiveCD
@@WolfyRed Do you have a time machine?
The guy didn't like. The -f folder was gone, wasn't it?
Edit: I meant "didn't lie" obviously.
@@monad_tcp I'm not. I'm using OpenBSD. Also you know there are other distros than suicide linux, right?
@@callisoncaffreywhat Tf is "suicide Linux"?
@@WolfyRed You type one command wrong and it deletes your hard drive. Can't recommend.
@@callisoncaffrey same thing can happen in windows, there's a reason why there is administrator's code of conduct.
@@fltfathin What? Please state what you impression of me is.
Sudo rm -rf /* is the System32 deletion of Linux.
more like deletion of / (hidden root folder in windows) that includes all partitions
Its more like deleting the the whole C drive and all other drives that are attached
The first part, gave me PTSD!!!! I once had a file in my home directory called "~".
GUESS what command I run to remove it!!!
Damn😂😂
Self-initiated homelessfication protocol
as a non bash user... please show me what command did you run
@@lukasjetu9776 I was inside my home directory and I run: `rm ~`
@@godnyx117 what all did it delete?
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.
Finally beluga but it's a Linux channel
U deserve more subs
That's what my brother has been saying
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 /*
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()
all you have to do is “rm -rf -- '-f'”
LMAO that Ducktales moon theme song hit out of no where.
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.
That " /* " makes all the difference in the system.
So, wake up, Arch user, wake up and smell the upgrade bork.
would it be logical for rm -rf /.. to disintegrate everything connected to the system bus?
That’s one way to take out the trash
ba dum, tsss
rm -rf /* removes EVERYTHING so you effectively brick your system.
@@parkman29 want to test your luck?
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.
It has been decades but Take off and land still gets me
it's blatantly realistic, great video 🐧🖤
Oh man I had that problem when I was first starting with Linux.
The first thing the noob at the terminal does = "sudo rm -rf /*"
Photorec - vomits all your files into a big pile
I really, really thought that I was watching Beluga for a sec lol
I wanted to sub to some random due who had no content and found you, gongrats… I guess?
Thanks! Your video content is the safest and most useful
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
Nice Beluga style video. Keep going!
Bless photorec
This was so emotional and inspirational
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.
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.
And that's the moment that he remembered that he have fucked up 💀
are you referencing the homework folder 💀
🤣🤣💀💀@@sylv512
this seems like a beluga clone
rm -rf "-f" and you made it
Beluga, but he uses Linux. And I like it
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. :|
my will to live when I started middle school
Send them this instead so they (most likely) cannot recover their data: 'dd if=/dev/random of=/dev/sda bs=4096'
a real villain 😈
What does this do?
@@Noob-gb6bn It corrupts your disk with random gibberish.
@@electric7487 aight thx, but how?
@@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, the location of your hard drive's main partition.
An alternative is "dd if=/dev/zero of=/dev/sda", which overwrites /dev/sda with zeros instead of random data.
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.
Yfw you run >rm file * instead of >rm file* 💀
rm -- -f
might work
But I suspect it wont format in RUclips.
This is also correct
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
Tha one windows user: Wait, my os is giving me errors
Everyone who watches Toy Story 2 will remember this
--no-preserve-root has left the chat
Technically it did delete it
How do I restore the files?
From your daily backup, of course.
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.
guild* 🤓🤓🤓
you could just rm -r -- -f
windows user moving to linux
Its the "alt + f4" of linux
Just like PDN admins, except they won't bother to restore
he said '-r -f', no '-rf'
I am familiar with this procedure. It is a pain to recover a whole windows system after writing rasbian over the first 2 gigs.
Once I had to do this to remove a kally linux instalation, and it worked.
Why does he keep so many low-res photos?
that’s his homework folder
always protect your homework folder
Use this: --
So it would be, rm -r -- -f
When you use clouds, you don't really need big backups. BTW, files you own end up owning you.
Bro, what clouds do you use?
@@character640p guava ice geekbar
@@nothanks5531 what does it even mean?
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.
Use btrfs and you can run rm -rf /* any time you want
I dont make backups, I upload everything on the internet!
Nahh bro just told him to delete all files in root directory
Who needs backups if you can just reinstall the system
The more terrible thing is mess up if and of in data duplicate command
You don't have to type sudo, if u r already logged in as root
How would you delete a folder named -f? Genuinely asking
Two options:
1) rm -r ./-f
2) rm -r -- -f
@@Virbox or you know just use the gui
@@warmike you can't if you are ssh-ing into a server
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.
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)
What a good ending!
I have absoultly no idea wth this is about
Nooooooo - not LMMS...
It's going to take forever to re-install all those plugins 😢
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
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)
Just run
rm -r -- -r
i did that in my archiso and its boomed
rm is depreciated, use shred instead
no
rm -r -f /* --no-preserve-root
you know - if your file system supports snapshots, it isnt that bad....
That's why I use btrfs or zfs
Fun fact: I already deleted my home folder doing this
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.
@@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.
Actually you need "rm -rf /* --no-preserve-root"
distro-dependent, i think
A permission error you say, why not do
sudo chown -R /
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.
"[~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.
Just rm "-f"
This should be an amine
I could learn something from you guys
silly little me did sudo chmod /* 000, worst mistake of my life.
not another baluga
Yea I ran it before in cmd and it broke my computer gpedit and regedit all gone😢
_r/technicallythetruth..._ 😹 It'd definitely get rid of the file you wanted to get rid of...
just cp lib and src, rm rf the projects and make new projects folder
If you want to have a clean filesystem you should create it new instead remove all the files. 😊
HAHAHA This is so true XD.
Wait, `rm -r \-f` wouldn't work?
Well, guess I need to test that myself.
I guess it's maybe because of the backslash, linux uses the forward ones
upd: yep, he wrote that in the description
@Watcher no, you escape the character “-“, which yields “-“, and so that backslash does absolutely nothing
Put it in ""
what dies rm -r ./-f do?
... is 'sudo rm -rf' the alt F4 of linux?
It's the delete C:\ of linux
It deletes every single file on your drives, every single file on any USB drives attached.
Even network drives get wiped.
Delete system32?
sort of, but a bit worse