{"repo":"zdk/rm-safely","free":true,"listed":false,"github":"https://github.com/zdk/rm-safely","clone":"git clone https://github.com/zdk/rm-safely.git","description":"'rm' safely – a safety net for rm","language":"Shell","stars":102,"topics":["backup","bash","command","command-line","filesystem","restore","rm","security","shell","trash"],"license":"MIT","category":"cli-tools","readme_excerpt":"rm-safely rm safely. Let's rm safely with no anxiety. Because the rm command does not come with any personal protective equipment. This light shell function makes rm safer, especially the default MacOS rm . By wraping you a safe rm from any accidental deletion of files or directories e.g. accidental autocomplete, sub-shell or script bugs etc. Keys , - Zero dependencies — pure shell script - Save files in /.local/share/Trash and in /.Trash-$(id-u) for mounted volumes. - Tested on: - Shell - zsh - bash - OS: - macOS 15.5+ - Linux arch-linux 6.17.1-2-cachyos Demo Install Via homebrew: Or, via curl: curl -fsSL https://raw.githubusercontent.com/zdk/rm-safely/main/rm-safely bash -s install Usage Use rm command to delete things as usual, but safer ＼(◎o◎)／ In other words when you run rm -rf file directory/ You will have the copied of files/dir in the trash first, then you can decide to delete or clean them later on. Additional features Really Remove Well, if you don't really care to move it to Trash first. You could just /bin/rm directly it's always there for you. Or, you can also use --rm option of rm-safely to bypass rm-safely protection. That means, use rm --rm For examples: - remove files and directy with OS rm. rm --rm file directory/ - see the OS rm --help --rm is nothing special other than execute /bin/rm from current shell. Uninstall curl -fsSL https://raw.githubusercontent.com/zdk/rm-safely/main/rm-safely bash -s uninstall Notes - Main goal of rm-safely is to write it in a p","default_branch":null,"files":null,"tree":[],"storefront":"/r/zdk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zdk/rm-safely/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}