Skip to navigation

“trash-cli” lets you move files to the trash from the command line (and shell scripts)

I know hardcore Linuxers use rm for everything and think the trash on a computer is for babies who also like such poo-poo things like the mouse and GUIs. However, I’ve just deleted one too many files using rm from a shell script, especially since I like doing rm -rf on directories … confirming every single file is just too tedious. So I googled some and found the best of both worlds: trash-cli lets you move items to the trash can from the command line or shell scripts. You use it simply like so:

trash somefile

Unlike just moving files to wherever you trash folder is using mv, trash-cli does all the nice trashy things like keeping information that will let you easily restore the file (which … ahem … you of course do from the trash can GUI). On Ubuntu, it’s easy to get trash-cli via synaptic:

sudo aptitude install trash-cli

Now, if there only were a way to rename the trash can to “trash” or at least “rubbish” instead of the idiotic “wastebasket” that my Xubuntu with GB locale insists on …

Comments are closed.