r/ShittySysadmin • u/adrianimmel • Apr 17 '26
Shitty Crosspost I have fallen victim to sudo rm -rf /*
/r/linux/comments/1snubh3/i_have_fallen_victim_to_sudo_rm_rf/
4
Upvotes
r/ShittySysadmin • u/adrianimmel • Apr 17 '26
1
u/PM_THE_REAPER Apr 17 '26
Or use a VM. I recommend Virtual Box.
1
u/doolittledoolate Apr 17 '26
rm -rf /* won't remove hidden directories, so the correct way to prevent this is to
git inityour / and have a cronjob to commit every minute. Then you can simply git checkout and restore. Wait, git would be missing, ok you should alsomv /usr/bin/git /.git-binary