Skip to content

Instantly share code, notes, and snippets.

@gabrielmansour
Created November 30, 2009 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielmansour/245223 to your computer and use it in GitHub Desktop.
Save gabrielmansour/245223 to your computer and use it in GitHub Desktop.
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export LC_CTYPE=en_US.UTF-8 # for textmate svn bundle repo
# A "safer" rm; moves file to Trash instead
function trash() {
target="$HOME/.Trash/"
filepath=$(eval echo \$${#}) # trying to get last argument; don't know how to do so without using eval
file=$(basename "$filepath")
if [ -e "$target/$file" ]; then
# File with same same already exists in trash; give it a unique name
target="${target}/${RANDOM}_${file}"
fi
mv "$filepath" "$target"
}
alias "rm=trash"
alias 'rm!=/bin/rm'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment