3 ms·
Good for you! I've lost most of my "childhood coding" stuff to an accidental `rm -rf /home /something` (note the extra space. Backups? what backups?) some ~18 y
by ivan4th 7y ago
Good for you! I've lost most of my "childhood coding" stuff to an accidental `rm -rf /home /something` (note the extra space. Backups? what backups?) some ~18 years ago. That included a couple of DOS viruses, one of which was polymorphic (I wrote them just for fun and never spread them; did upload one to an antivirus vendor BBS back then through their "Submit a new virus" function and it's still in many databases because of that); a C++ rewrite of mars.exe voxel landscape generator, but with added rotation, music and lakes; a PWM-based WAV player for PC speaker; etc. I'm still quite sad about that accident ...
- bonzini 7y agoI remember an equally disastrous "rm -rf * ~". Again, notice the space, and also how the -r was completely unnecessary. Fortunately these days everything is in version control and my editor doesn't clutter the current directory with backups anymore
- zshrdlu 7y agoThis is the reason I adopted 'find . -type f -name "*~" -delete'.
- colejohnson66 7y agoIs there a way to stop rm from running if there’s a space?
- dllthomas 7y agoIf you're okay with being unable to remove multiple files at once...
- semi-extrinsic 7y agoIIRC, zsh has an option such that if you type `rm -rf /folder` it will ask Sure you want to delete /folder with 382 files? (Y/N) This would at least give you a chance to spot that it was asking about the wrong file.