I would like to make the rm command move "deleted" files to a trash folder instead of wiping them off disk. Similar to how a file delete in KDE works for example.
Any ideas?
Many thanks
That's a very bad idea -- even worse than that alias rm="rm -i" thing that some people use.randal1 wrote:I would like to make the rm command move "deleted" files to a trash folder instead of wiping them off disk. Similar to how a file delete in KDE works for example.

Code: Select all
export PATH=~/bin:${PATH}
Code: Select all
#!/bin/bash
#write script here that does what you want. for a poor (but mostly working) example of rm emulation...
mv "$@" ~/.shtrash/

Code: Select all
#!/bin/sh
kfmclient move "$@" trash:/