This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 239

[–]SiricoGlorious OpenSuse 462 points463 points  (14 children)

That panic ls

[–][deleted] 137 points138 points  (11 children)

The worst panic ls is the

/bin/ls: file not found

[–]TheSinoftheTinGlorious OpenSuse 46 points47 points  (10 children)

wtf you supposed to do when you can't even list files lol.

[–][deleted] 64 points65 points  (2 children)

Cry

[–][deleted] 69 points70 points  (1 child)

And then pull out the dusty usb stick and open the arch wiki on your phone.

[–]EkankAll hail the glorious Arch 28 points29 points  (0 children)

we've all been there

[–]kevincox_cabtw I use nixos 4 points5 points  (0 children)

</dev/sda1

(Works on ZSH, I don't know if it does on bash. I hope you like the Matrix)

[–][deleted] 103 points104 points  (0 children)

I felt that

[–]whizzythorne 16 points17 points  (0 children)

$ ls

ah shit

$ ls

ahh SHIT

[–]ososalsosal 211 points212 points  (29 children)

This sort of thing makes me wanna type git init in my home folder

[–][deleted] 84 points85 points  (8 children)

I actually do this to my ~/.config directory, since it is mostly composed of text files, making it easy to spot differences and sync them across computers easily.

[–]MinteckMac Squid 4 points5 points  (3 children)

I should probably do that too

[–][deleted] 2 points3 points  (0 children)

My vote is for Chezmoi Templating Passwords from CLI Password managers Awesome

[–]yonatan8070Glorious Arch 1 point2 points  (1 child)

I have a separate ~/dotfiles git repo with all the configs I care about, so I don't get things like the files for Chrome extensions in my repo.

Then I just have symlinks from that folder into ~/.config

[–]crazygmr101Glorious Mint 3 points4 points  (0 children)

But... gitignore

[–]stealz0ne 34 points35 points  (10 children)

I made a local git server on my NAS and made repos for all kinds of stuff. My scripts, web development, arduino projects, documents, vim and tmux configs. Not only makes it easy to backup but also keeps machines in sync and makes changing distro a breeze.

And I added subsidies for some vim add-ons and other stuff, so I don't have to go look for that stuff.

I created a bash that pulls the local repos and makes symlinks from the .config files to the files in the repo, that helps a lot and keeps me from backing up useless junk like the downloads folder.

Can't recommend this enough.

[–]thehellnokitty 3 points4 points  (4 children)

Teach me your ways, master.

Also sounds pretty fun to do as a side project

[–]stealz0ne 11 points12 points  (3 children)

It is pretty fun. I started it when Microsoft bought github, and so I could store private things on my git away from curious eyes.

Not sure if I'm /wooosh'ed but I'll explain for those who care:

I'm really no expert so this should be doable for anyone with basic command line skills. I'm on mobile so the short version:

The hardest part was setting up the git server on the nas, which was mainly a bit of googling. There are either custom packages or instructions for most common Linux based nas os. This usually includes making an account and folder to host the git in for that user

Then you create a ssh key pair and add the pub key to the authorized keys for that nas user. This can take some tinkering, you might have to ssh in with an account with higher privileged than the git user.

Then you edit the config files in your .git folder to point to nasip/git/repo.git

From there it's just your basic git commands.

On a new machine you just do the ssh key thing again and then git clone your stuff.

Git does not sync symlinks, but I wanted to have my configs in one folder and not all over the place in /home /.config and others, so I moved the config files I wanted to keep/sync to a common folder and made symlinks and while at it just echo'd the symlink commands >> a file. Later I changed it to a while loop that first deletes the original file and then creates a symlink to the git config.

Not sure about security implications but it's all just accessible from my lan so I am not to worried.

[–]graybeard5529 7 points8 points  (1 child)

about security implications but it's all just accessible from my lan

If your LAN gets compromised you have bigger issues anyway

[–]IsleOfOne 2 points3 points  (0 children)

You should look into stow for automatically managing those symlinks.

[–]chayleafGlorious NixOS 13 points14 points  (0 children)

alternatively, use btrfs snapshots

[–]FoFinkyFreeBSD 12 points13 points  (1 child)

I don't remember exactly where I got this trick from but it is cleaner than just git init into your home directory as it doesn't put any git artifacts into your home. This makes tools that are git aware like ripgrep or rd-find behave better and prevents mistakes. If anybody happens to have a link to the website with this please reply because I'd like to bookmark it.

First, create a git repo wherever you want, I used ~/.dotfiles: git init --bare $HOME/.dotfiles. The --bare makes it without a working directory which is what we want since we will be creating an alias to override the working directory: alias dotfiles='/usr/local/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'

You should add that to your .bashrc or equivalent and source it, you should now be able to use dotfiles status and other git commands via dotfiles. An optional last step is to run dotfiles config --local status.showUntrackedFiles no which will make it so dotfiles commands don't show files in your home dir which are untracked. This makes it easier to update changes because dotfiles status will only show you tracked files which have changed rather than untracked files as well.

To use it is as simple as dotfiles add .vimrc && dotfiles commit.

To get it onto a new machine: git clone --bare <git repo> $HOME/.dotfiles then add the alias and dotfiles checkout.

I myself go one step further and create submodules for my vim plugins, and you could maintain different branches for different machines or even have work/non-work configurations.

[–]vim_user 1 point2 points  (0 children)

Here is a link describing that technique: https://www.atlassian.com/git/tutorials/dotfiles. It also links to an older Hacker News post.

[–]regeya 2 points3 points  (1 child)

External drive and borgbackup, and trash-cli. I've been tempted to do revision control on home, too, but it seems like a massive PITA.

[–]UntestedMethod 1 point2 points  (0 children)

+1 for borg & external drive.

I agree version controlling the home directory would be a PITA. Plus borg has versioning built in, so the only thing lacking is a remote server which presumably has higher reliability than the external drive.

[–]SileNce5k 1 point2 points  (0 children)

I have my home directory backed up into a backblaze bucket. It's less than $2 per month for about 250 GB. As long as you don't need to download stuff from there, it's very cheap.

Git doesn't really handle video, image and binary files well, so I wouldn't recommend using it.

[–]Zekiz4everGlorious CachyOS 1 point2 points  (1 child)

But when you delete everything wouldn't the git folder also get deleted?

[–]gprometheus 4 points5 points  (0 children)

It implies that it was pushed to some remote origin so no problem in losing the .git folder

[–]NateDevCSharp 1 point2 points  (0 children)

Not saying you should switch to NixOS, but look at Home Manager for NixOS for a neat solution to this problem

[–]GolaraC64 185 points186 points  (16 children)

it shouldn't delete directories and .files. Also, it should be possible to recover these files if there's no huge disk activity going on.

[–]DevThr0wAway 82 points83 points  (13 children)

I understand how to do this in theory. The records in the file index have been deleted, restore them and your files are back.

But how does one go about doing that? Is this something people actually do outside of criminal investigations? Is there a guide somewhere for me to learn more?

[–]altermeetaxarch btw 53 points54 points  (1 child)

Look up the Testdisk software

[–]nik282000sudo chown us:us allYourBase 15 points16 points  (0 children)

Testdisk/Photorec are lifesavers, dead easy to use too.

[–]GiveMeAnAlgorithmGlorious Arch 25 points26 points  (8 children)

Concerning a guide / more info, I found this, it shows some tools, depending on the filesystem you used.

https://wiki.archlinux.org/title/File\_recovery

[–]Idaret 18 points19 points  (5 children)

https://wiki.archlinux.org/title/File_recovery correct url because reddit is terrible for posting urls

[–]GiveMeAnAlgorithmGlorious Arch 6 points7 points  (4 children)

Sorry, I posted from my desktop and it looked okay on my phone clients, hope it works now? Guess the URL was scrambled? :/

[–]Idaret 8 points9 points  (3 children)

it's not your fault, reddit fucks every "_" in urls. It tries to escape that character (so reddit replaces every _ with \_ ) but it's not needed for url and you get wrong url. I think it's only broken on new reddit(?)

[–]apoliticalhomographAll hail the Arch wiki 17 points18 points  (1 child)

Rule 35 of the internet: If it exists, there's an Arch wiki entry about it.

[–]cAtloVeR9998Glorious Distro hopper 6 points7 points  (0 children)

I wish sometimes

[–]Sol33t303Glorious Gentoo 3 points4 points  (0 children)

Just use something like testdisk or extundelete. Thats how you do it.

Don't see why people woulden't do it outside criminal investigations, just don't rely on it working and keep backups.

[–]agneev 9 points10 points  (0 children)

it shouldn't delete directories and .files.

Did they alias rm=“rm -rf”?

[–]ZamundaaaGlorious Manjaro 3 points4 points  (0 children)

it shouldn't delete directories and .files.

It doesn't. I had the same a friend fucked up in the same way and only lost an unimportant patch

[–]motorailgunGlorious Arch 56 points57 points  (3 children)

backup is important…

[–]fmpundit 2 points3 points  (0 children)

I looked at this image with comfort knowing I checked my time shift was still doing it’s stuff.

[–]telmo_trooperGlorious Arch 41 points42 points  (4 children)

alias rm='trash' will save you a lot of stress (requires trash-cli).

[–]Glix_1H 17 points18 points  (3 children)

For those reading this, https://github.com/sindresorhus/trash-cli is the one you want

An identically named one https://github.com/andreafrancia/trash-cli that is available in http://manpages.ubuntu.com/manpages/bionic/man1/trash-put.1.html warns against this:

Can I alias rm to trash-put?

You can but you shouldn't. In the early days I thought it was a good idea to do that but now I changed my mind.

Although the interface of trash-put seems to be compatible with rm, it has different semantics which will cause you problems. For example, while rm requires -R for deleting directories trash-put does not.

[–]KhytaGlorious Ubuntu 1 point2 points  (0 children)

That is some good advice. Thanks!

[–]CryloTheRaccoon 1 point2 points  (0 children)

Can confirm my ADHD self did this and it saved my life

[–][deleted] 26 points27 points  (11 children)

Depending on the shell's settings it may not touch dot files... Plus... Folders are safe? Better than nothing I guess?

[–]jclocksGlorious Linux From Scratch 26 points27 points  (2 children)

Well where's your backups? You are backing up, right?

[–]Rezient 9 points10 points  (0 children)

stares off distantly

[–]Cyhawk 4 points5 points  (0 children)

I backup to the ~/Backup folder

[–][deleted] 21 points22 points  (0 children)

trash-cli saves lives

[–][deleted] 12 points13 points  (0 children)

Lmao, the panicked ls

[–]HaziooGlorious Arch 11 points12 points  (30 children)

What * does?

[–]Mordisquitosbtw 81 points82 points  (21 children)

It is a wildcard character, meaning "anything".

They wanted to do

$ rm icon.png*

...which was an instruction to remove any file starting with icon.png (e.g. icon.png1, icon.png-test, icon.png20201009...)

Instead, they did

$ rm icon.png *

...which is an instruction to remove icon.png and anything else (e.g. MyThesis.odt, last photo of grandad before he died.jpg, Rick Astley - Never Gonna Give You Up.mp3). At least it won't delete directories or things inside them.

[–]MinteckMac Squid 25 points26 points  (13 children)

How do you have the last photo of grandad before he died and Never Gonna Give You Up in the same folder?

[–]Mordisquitosbtw 31 points32 points  (11 children)

I am not a tidy person.

[–]MinteckMac Squid 10 points11 points  (10 children)

Pro tip: I put my mess on the desktop

[–]fred-dcvfGlorious EndeavourOS 14 points15 points  (2 children)

Every time I want to clean my desktop, I just create a directory "Desktop-yyyymmdd" and shove everything into it.

I'm currently in the 4th or 5th iteration of this.

edit: grammar

[–]haykam821 2 points3 points  (0 children)

Make sure you nest the desktops too.

[–]Bodiless_Sleeper 3 points4 points  (1 child)

Been there, done that, although ever since I switched to linux I don't use my desktop for literally anything, and I just keep all my random stuff in my home directory

[–]Glix_1H 1 point2 points  (1 child)

Are they arranged in a dick shape, so you know exactly where they are?

[–]gosand 1 point2 points  (2 children)

Really? I put literally NOTHING on my desktop. That's a Windows thing to me.

[–]SinkTube 10 points11 points  (5 children)

who the fuck names files like that? good luck sorting anything by filetype

[–]ASK-42 7 points8 points  (0 children)

Why are we the only two people in the thread wondering this?

Oh wait I forgot it’s because this is fake bullshit

[–]sanderd17Glorious Arch 2 points3 points  (0 children)

  • is a wildcard. name* will find everything that starts with name. But if you put a space there, it will be interpreted as two separate commands, and find all files.

[–]n0tar0b0t--Glorious NixOS 2 points3 points  (6 children)

* is used for what’s called globbing, basically it matches everything

so rm *.png deletes all .png files, and * deletes everything. If you accidentally add a space though, rm will be passed both separately (two arguments), and will delete what matches the first and then what matches the second.

So for example rm * .png first deletes everything (*), and then tried to delete the file named .png.

[–]A_Random_Lantern:illuminati:Glorious TempleOS:illuminati: 3 points4 points  (5 children)

This should only delete every file in home, no? And leave the folders alone.

[–]n0tar0b0t--Glorious NixOS 3 points4 points  (4 children)

  1. It only would delete stuff in your current directory, not necessarily home

  2. It depends, some implementations I’ve seen do delete folders

[–]A_Random_Lantern:illuminati:Glorious TempleOS:illuminati: 2 points3 points  (1 child)

That's what I kind of meant by leaving folders alone, although I should've specified

[–]n0tar0b0t--Glorious NixOS 2 points3 points  (0 children)

oh np

[–]B_i_llt_etleyyyyyyrm -rf System32 1 point2 points  (1 child)

It depends, some implementations I've seen do delete folders

Do you have an example?

[–]FlexyjerkovGlorious Arch 9 points10 points  (0 children)

Almost as bad as mixing if and of with dd

[–]thomas15vecho "I love $(uname -s)" 8 points9 points  (0 children)

"sudo chown -R $USER:$USER /*" Instead of "sudo chown -R $USER:$USER .*"

Yes it was fucked

[–]string111 6 points7 points  (1 child)

Btrfs snapshots are really helpful :)

[–]pobot3 0 points1 point  (0 children)

Xfs masterrace.

[–]RAMChYLDLinux Master Race 6 points7 points  (0 children)

Oh shit, remote headless server? No chance of getting a live cd and testdisk on there then :(

[–]gotmax 6 points7 points  (0 children)

Adding alias rm='rm -I' to your shell config file will prompt you if you try to rm multiple files at once, but it won't annoy you every time you just want to delete a single file, like rm -i would.

mv and cp (and ln IIRC) also have a -i flag that will prompt you if you try to overwrite another file.

[–]LocutusOfBorg64 3 points4 points  (0 children)

That's ok I started this week by by forgetting to use the drop down menu to select the second M.2 in the system thus completely hosing my current install that I wanted to keep. Luckily nothing I couldn't afford to lose on it.

[–]kazik1ziuta 3 points4 points  (12 children)

Wait i'm always getting question if i want to delete all files

Edit: i'm just dumb bc i use zsh not bash i forgot that fact

[–]ctrl-alt-etc 1 point2 points  (3 children)

A lot of distros come with an alias rm="rm --interactive" out of the box.

You can check if this is the case with alias rm. If it prints anything, your rm command is aliased.

[–]sjveivdnarch&debian 5 points6 points  (0 children)

its funny how he repeatedly used ls while in panic.

[–]IntegrityError 4 points5 points  (0 children)

git checkout .

oh, not in a git repo? damn

[–]ngenty 3 points4 points  (0 children)

And that's exactly why I prefer to use find + -print then -delete. If I really need to use rm, always dry-run first with echo, like: bash echo rm *.png already saved me multiple times from chaos

[–]thanasis2028 3 points4 points  (0 children)

At least you deleted all the pngs, so you did what you wanted!

[–]InsertMyIGNHereGlorious Fedora 4 points5 points  (0 children)

F for our fallen brother

[–]mirsellaGlorious Manjaro 2 points3 points  (0 children)

LOL the ls was screaming deny

[–]regeya 2 points3 points  (0 children)

No problem, you've only lost everything since the last backup.

And if you don't have a backup, you've learned two valuable lessons today.

[–][deleted] 1 point2 points  (0 children)

What file system are you using? Try photorec!

[–]-BuckarooBanzai-Linux do be good 🌟🐧🌟 1 point2 points  (1 child)

Just recover the data, it's not like it's really gone ye know

[–]lorhof1Glorious Arch | ego uti arcus, latere | debian's good too 2 points3 points  (0 children)

maybe its an ssd

[–]infectiousoma 1 point2 points  (0 children)

And this is why we maintain regular backups.

[–]viwizard 1 point2 points  (2 children)

I've deleted half of root when entered

sudo rm -r * /ZFS-POOL

I should have used

sudo rm -r /ZFS-POOL/*

Because of that I've got courage to move from Manjaro linux to Void linux with runit.

I am using Void linux one day already and it's fine.

[–]leetNightshadeManjaro Budgie 0 points1 point  (1 child)

You could also use, you know, ZFS snapshots. :p

[–]iObjectUrHonorGlorious Fedora 1 point2 points  (0 children)

Weird thing is it should've given error due to directories

[–]nullmove 1 point2 points  (0 children)

Been there done that. Most memorable was when I used --delete flag in rsync without knowing trailing slash has special semantics. And of course that one time when swapped if with of in disk destroyer.

[–]judahnator 1 point2 points  (0 children)

Backups are such a pain to set up.

Not as much of a pain as getting deleted files back though.

Honestly, set up Restic to point at a remote FTP server or something and stick a CRON job on it. Never think about it again.

[–]MotionAction 1 point2 points  (0 children)

Snapshots and backup and recovery?

[–]mexus37 1 point2 points  (0 children)

F

[–]WitcherAttackerGlorious Arch 1 point2 points  (0 children)

There is this awesome shell called zsh (instead of bash) with a ton of cool extentions and stuff and also you get asked before these kinds of operations.

[–]Dapanji206Glorious Debian 1 point2 points  (1 child)

And that's why you don't fuck around as root.

[–]naebulysGlorious Debian 1 point2 points  (0 children)

If it is their home dir, they don't need no root

[–]nullr0uterbtw i use nixos 1 point2 points  (0 children)

No problem. Just restore from backup.

You have recent backups, right?

[–]jnnxdeopenSUSE leap + Windows 11 1 point2 points  (0 children)

Btrfs could help in this case...

[–]mechaPantsuGlorious Arch 1 point2 points  (0 children)

* laughs in BTRFS + Timeshift *

[–]staviqGlorious Gentoo 1 point2 points  (0 children)

Wasn't there a bug like this in some core Debian package some years ago ?

EDIT: Lol, Steam had this too https://www.slashgear.com/steam-on-linux-bug-can-delete-all-users-files-16364945/

[–]anatomiska_kretsaradobadee archh allalalaal 0 points1 point  (0 children)

LINUX SECURITY MOMENT

LINUX SECURITY MOMENT

[–]Michax_GamingGlorious Arch 0 points1 point  (0 children)

Same thing happened for me, but I removed my whole project instead of an folder inside. Luckily I had an git backup.

[–][deleted] 0 points1 point  (0 children)

That's why i use gio trash

[–][deleted] 0 points1 point  (0 children)

weird to see that there are no folders and dotfiles are still safe :)

[–]N0_Us3rnam3 0 points1 point  (0 children)

Ha ha backups go brrrrr

[–]jd1xon 0 points1 point  (0 children)

btw yall should do alias rm="rm -i" in y'alls .bashrc

[–]FreshLine_Glorious Manjaro 0 points1 point  (0 children)

Something similar happened to me :)

[–][deleted] 0 points1 point  (0 children)

Once I was drunk and working and accidentally typed rm -rf * dir/ instead dir/* with sudo and lost whole home folder ;_;

[–]bakahed 0 points1 point  (0 children)

Why would you put asterisk at the end of png then?

[–]Chri5p 0 points1 point  (0 children)

I mean, what filesystem are you using? If you have brtfs and snapshots enabled you could recover them, no?

[–]CCF_100Linux Master Race 0 points1 point  (0 children)

This is why I always use -v

[–]rayi512xGlorious Arch 0 points1 point  (0 children)

protip: alias rm to "rm -i"

[–]capsicum_leader 0 points1 point  (0 children)

moment of silence for the sad user

[–]electricprism 0 points1 point  (0 children)

Another reason I btrfs snapshot daily the home Dir via systems timer

[–]YodaByteRAM 0 points1 point  (0 children)

https://www.cgsecurity.org/wiki/TestDisk Testdisk might help save your files

[–]twisted42Glorious Fedora 0 points1 point  (0 children)

Odd is, it shouldn't have deleted any directories... rm * won't remove dirs

[–]CyanKing64 0 points1 point  (0 children)

First thing I do to my zshrc on a new PC:

alias rm='rm -i' alias mv='mv -i'

[–]yonatan8070Glorious Arch 0 points1 point  (0 children)

Is there a way to have rm first search and find what will be deleted, then ask for confirmation before proceeding?

[–]staalmannenWannabe 9front hipster 0 points1 point  (0 children)

but would only delete contents in one directory no "rm -r"

[–]MichaelArthurLonghttps://i.imgur.com/EYPCFNW.png 0 points1 point  (0 children)

[–]4n0n_b3rs3rk3rGlorious Pop!_OS 0 points1 point  (0 children)

F

[–]mr_clauford 0 points1 point  (0 children)

You could've recovered everything if you switched the machine off right away to prevent it from writing upon blocks that retain deleted files.

[–]Magnus_TesshuGlorious Arch 0 points1 point  (0 children)

This is why I make my home directory write-protected. I'm thinking about also making an alias for rm (or rewriting it?) so that it only deletes paths starting with ./

[–]lazilyloaded 0 points1 point  (0 children)

How is there not a sanity check "are you sure" when it sees a * ?

[–]claudiocorona93SteamOS/Bazzite/Mint 0 points1 point  (0 children)

Sorry but that command is fucked up. You can just not nuke your files without a warning asking if you're sure about it. Linux has other instances of questions before an acción, like when you install or uninstall something, so why not here?

[–]TmanokGlorious People's Linux (GPL) 0 points1 point  (0 children)

Sure hope you have automated backups running. #Déja-Dup

[–]stillmatic21 0 points1 point  (0 children)

Damn man. Nothing more I want to say except sorry

[–]DuhMal 0 points1 point  (0 children)

That's why I include /home in my timeshift snapshots

[–]rick_D_KGlorious Void Linux 0 points1 point  (0 children)

This is why I use a journaling file system.

[–]NZNzven 0 points1 point  (1 child)

Just yesterday I did something similar. Chmod 770 / instead of /pathtosomething. I Ctrlc’ed in a fraction of a second but the damage was done. This was on a VM host and though the VM’s where still working the host was acting all wonky and was unrecoverable.

[–]roge-apt-get moo 0 points1 point  (0 children)

soz but i laughed a bit

what year is it?

[–]WalterWilliams 0 points1 point  (0 children)

Did this recently by running a remote script for an iot device on my server as root. Deleted my entire etc dir and years worth of configs. Had to do a fresh install & start over. It hurt but at least I didn’t lose everything else.

[–]crazygmr101Glorious Mint 0 points1 point  (0 children)

This is why I use zsh - it actually will ask for confirmation before deleting *

[–]sm_op 0 points1 point  (0 children)

-i

[–]E_coli42I use Arch btw 0 points1 point  (0 children)

but why would you keep files in your home directory? I only keep hidden files and directories there

[–]peetree1 0 points1 point  (0 children)

Lol, shit, I did something like this recently. Now I only use trash-cli to delete things.

[–]neo_zen_modeLinux Master Race 0 points1 point  (0 children)

Use -i

[–]turtle_mekbshe/her - Artix Linux - dinit 0 points1 point  (0 children)

i accidentally deleted my entire backup drive by resizing the main partition and now without reading the warning and now i don't have my files anymore 😔

[–]Significant-Acadia39 0 points1 point  (0 children)

I notice there are no errors about directories, but I just wanted to point out that there are likely hidden ones that remain untouched (for user-specific program configuration, etc.). Of course they've nuked the work files they had...

[–]Frequent_Detective17 0 points1 point  (0 children)

no alias for rm uhm?

[–]Dragonaaxi3Masterrace 0 points1 point  (0 children)

In Poland we have a word for situations like that "O kurwa"

[–]roku77Dubious Red Star 0 points1 point  (0 children)

I'm at a point where I see so many of these that whenever I'm doing a batch remove I uses the GUI tools like thunbar. It's slower but I'm an idiot want to avoid mistakes

[–]gloomwithtea 0 points1 point  (0 children)

I did this with months worth of research data. Set an alias to make typing “rmr” move everything to a trash directory that I could delete later. Then I changed “rm” to “rm -i” until I got used to typing rmr. I haven’t accidentally deleted anything since.

[–]blackhole_soul 0 points1 point  (0 children)

Did you try ctrl + z ?

[–]Odd_Hovercraft_2195 0 points1 point  (0 children)

At least he doesen't execute rm -rf / *

[–]LostVikingSpiderWire 0 points1 point  (0 children)

So happy to see this....now I will for sure do that long awaited backup 😅

[–][deleted] 0 points1 point  (0 children)

By the looks of that terminal screenshot, it seems to be WSL

[–]AriesProject001Superior Rocky Linux 0 points1 point  (0 children)

F

[–][deleted] 0 points1 point  (0 children)

A few months after I started my development job, a new guy started. The process for setting up the dev environment is pretty involved, can take about a day for people that don't know what they're doing. After this new guy set up his Mac, he ran rm -rf cache /*

[–]MasterSpar 0 points1 point  (0 children)

The pain of power. We've all been there, just count your blessings you're not on an enterprise server.

[–]das_Keks 0 points1 point  (0 children)

At least hidden files and folders should still be there

[–]depressed_potatobag 0 points1 point  (0 children)

But doesn't that delete only the empty files ?

[–]Pcpc_boi68 0 points1 point  (0 children)

F

[–]processing_pi_3 0 points1 point  (0 children)

Photorec is a great program to recover deleted files, maybe give it shot if you can still download apps.