Skip to content

Instantly share code, notes, and snippets.

View WieeRd's full-sized avatar
☁️
dreaming of electric sheep

WieeRd WieeRd

☁️
dreaming of electric sheep
View GitHub Profile
@WieeRd
WieeRd / safe-rm.py
Last active August 6, 2022 11:18
A wrapper around `rm` command to prevent disasters
#!/usr/bin/env python3
"""
A wrapper around `rm` command to prevent disasters.
1. Put this script inside `~/.local/bin` (or anywhere on your system)
2. Enable the executable permission of the script using `$ chmod u+x safe-rm.py`
3. Add `alias rm=~/.local/bin/safe-rm.py` in your `~/.bashrc`
4. When removing 3+ files, confirm prompt with a list of targets to be removed will show up
"""