-
-
Save commanda/ff80c6b306f5fa8e25bf20c7292ab8a7 to your computer and use it in GitHub Desktop.
A bash script that moves the given file or directory into the Trash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TRASH="$HOME/.Trash/"; | |
args=("$@"); | |
for f in $args; do | |
base=$(basename $f); | |
if [ -e "$TRASH$base" ] ; then | |
TS=`date`; | |
mv -f $f "$TRASH/$base $TS"; | |
else | |
mv -f $f "$TRASH/$base"; | |
fi | |
done | |
# alias rm="echo Use 'del', or the full path i.e. '/bin/rm'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like
date +%s
for these sorts of things, since it's short and doesn't have spaces that make some applications sad.