rm. As you know,
rmjust kills a file or directory outright. Often this is what we want. But every windowing system I know uses an intermediate Trash Can, a place to store your deleted files in case you say "No, I really wanted that directory full of L0Lcats".
So, the question is, how do I get that functionality in your command line? They call it
del, but I prefer
delon Windows doesn't put it in the Trash Can, it blows it away.
Anyway, the code:
mv -vi -- "$@" $HOME/.Trash
Problems. When I tried this, the file was moved to .Trash, because there was no .Trash dir. Why was there no .Trash dir? Because with Ubuntu Intrepid (and I have no idea when things changed), the Trash dir is
$HOME/.local/share/Trash/. Specifically, there's
$HOME/.local/share/Trash/files/, which holds the actual files and directories, and
Let me show you a sample
For each file and directory in the files directory, there's a .trashinfo file saying when it was deleted and where it restores to. So, obviously, the
trashscript is not up to the task of today's Gnome trashing. But what to do about it? More later, as I consider the problem set.