
Ask HN: How do you use rm safely or which trash utility are you using? - xstartup
I accidentally rmed files which I had not committed to a repo. I tested several other utilities which should send the files.<p>a) trash-cli python - didn&#x27;t work, I got some error<p>b) nodejs one - worked but the files sent to trash have uuid as its name and it&#x27;s not recognizable.<p>Which trash utility do you use?
======
latexr
You haven’t specified your OS, but on macOS I use `trash`[1] (`brew install
trash`). Files are deleted by default using the Finder API, which means you
still hear the trashing sound and can use the “Put Back” feature, as well as
⌘Z to get them back.

[1]: [http://hasseg.org/trash/](http://hasseg.org/trash/)

------
pwg
Another alternative is to not use 'rm' day-to-day to delete files. Alias "del"
to "rm -i" and force the habit of using "del" to delete. You will then be
prompted per file (allowing you to avoid deleting those you don't want to
delete). Then reserve use of raw 'rm' for only those times when you _really_
mean to delete a file without prompting (and therefore, have hopefully thought
about if you _really_ want to delete these files for good).

------
onion2k
Delete things using `git rm <file>`. If it's not been committed then you won't
be able to delete it. If you want to actually remove the file before you
commit it use the -f option.

~~~
xstartup
Perfect! Thank you.

