I just discovered that there is a way to send files to the trash instead of just delete them using the shell and I think it’s really useful when you don’t want to totally discard something to the oblivion. I found out about this because I was working on the shell and I needed to remove some files to check if app could work without them. Move or rename them was an option, but I thought that perhaps there were a more efficient way to that and thought that send then the trash was the most efficient way, since from there they could be deleted forever or restored. think
I thought that perhaps the command
rm could have some flag or option that send the files or directories you wish to remove to the trash instead of delete immediately them. However, after read a little bit about the topic, I realized that use rm command is a bad idea and practice to send files to the trash.
You can read a little bit more about it here and here, but to summarize a little bit, it’s basically not safe. You can get use to use
rm to send thing to the trash and if for a moment you are on other computer or with other username you can delete things permanently.
1 2 3 4 5 6 # On Mac you can install with Brew brew install trash-cli brew install rmtrash # On linux you can install with apt-get sudo apt-get install trash-cli
On the previous links about the commands you have all the options you can implement in both commands.
PS/ You have to be aware that the shell trash is not the same you can see in your desktop or at least I could find them there. Perhaps, further config is needed.