This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
""" |