Skip to content

Instantly share code, notes, and snippets.

@theoremoon
Last active November 21, 2017 07:57
Show Gist options
  • Select an option

  • Save theoremoon/39d75258bb6ae94e09dbc0034a2b064b to your computer and use it in GitHub Desktop.

Select an option

Save theoremoon/39d75258bb6ae94e09dbc0034a2b064b to your computer and use it in GitHub Desktop.
# replace rm with move
gotrash() {
trashdir="$HOME/trash"
mkdir -p $trashdir
for f in $@; do
mv "$f" "${trashdir}/${f:t}_$(date +%s)"
done
}
alias rm='gotrash'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment