I accidentally ran rm -rf * while in ~ instead of the directory I meant to be in:///Luckily, I had a directory fairly high up in lexicographic order which contained files that had 0 file permissions. So the damage is manageable.
rm -rf *
hm no, that doesn't make sense then. I only had the recursive flag, not the force flag.
>>110454878make a backup anon
>>110454878alias rm='rm -i'put this in your ~/.whatevershellrc file
alias rm='rm -i'
>>110455595>>110454878just never run rm -rf *go up one directory and delete the directory. if you have to do this a lot and recreate the directory, make some wrapper that does it
>>110454878editing prod and you quickly slap out crontab -e but you typo and enter crontab -r the creators of crontab are trolls for not asking if you're sure
>>110456453>the creators of crontab are trolls for not asking if you're sureholy based...
>>110455547I know... I'll do it next week pinky promise>>110455834that's what I normally do, but the directory in question was a git repo, and I wanted to preserve .gitthe safe thing would've been to mv .git .. && cd .. && rm -r dir, but oh well
mv .git .. && cd .. && rm -r dir
>>110456453yeah, that one's rude, too. similarly for history -dI've also been bitten by usermod -G before, fun times editing grub's boot parameters to boot into root.
history -d
usermod -G
>>110454878
>>110456825as (partly) I need to rebuild my kot collection: save'd!!
>>110456844I got this picture from a guy on reddit, he saw this kot a few times when on the way somewhere and the kot was always looking very angry
>>110456882I haven't too many angry cats, unfortunately
this is why even minimal btrfs snapshots can be very beneficial. even something as minimal as a single hourly snapshot which takes up basically no space can totally save you from this kind of mistake being catastrophic
>>110454878>I accidentally ran rm -rf * while in ~How does that even happen?
>>110457491Yeah, I was planning on switching to btrfs or the like anyway. Will be doing that the same day I create a backup>>110457574When returning from some other task I often have to type in cd to get back to ~ cos that's the starting point of many endeavours so to speak.Because of that, I had gone to my homedir faster than I had consciously registered. It's comparable to that mechanised opening of your app of vices on your phone, playing with your jumper chord, adding a space after a word even though a comma/full stop follows.
>>110456825>>110456882
>>110457574it can sound funny if you don't use the terminal much and only open it to do a specific task, but if you have multiple terminals and do longer sessions with it, you can run into situations where the working directory is not what you think it is
>>110457857yeah I think this was the first picture this guy posted lol
>>110454878>So the damage is manageable.for a human
>>110454878I use zfs so this wouldn't affect me lol
>>110454878Well, did you manage it, OP?
>>110455595only pussies do this
>>110457574people stop paying attention sometimes. one time i thought i was in a chroot mode when i infact was not
Crazy how I have never had this problem in windows.>right click>delete>go to gym>have sex with young japanese girls>never worry that I accidentally deleted the wrong thing.>if I did go to recycle binWhy doesnt Linux get a Recycle Bin?
>>110462545it does, though using rm directly won't use the recycle bin.protip: using del in a windows terminal won't use the recycle bin, either, if op used a graphical file manager like you would in windows, it would use the recycle bin the same way it works on windows, this isn't a windows vs. linux issue
>>110462545>>110462558oh another thing is that even in windows you can still get overconfident using explorer. shift+delete will delete something directly, and more experienced users can get used to using it
>>110454878next time run shred first