Skip to content

Instantly share code, notes, and snippets.

@Pafuxu
Created March 24, 2009 13:40
Show Gist options
  • Save Pafuxu/84088 to your computer and use it in GitHub Desktop.
Save Pafuxu/84088 to your computer and use it in GitHub Desktop.
# .bashrc
# rmコマンド実行でゴミ箱へ
# 'rm' move ~/.Trash
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary
while [ -e ~/.Trash/"$dst" ]; do
dst="$dst "$(date +%H-%M-%S)
done
mv "$path" ~/.Trash/"$dst"
fi
done
}
# grep option
alias grep='grep -i -E --color=auto'
# ls option
alias ls='ls -lG'
alias la='ls -a'
alias lsl='ls | lv'
alias lal='ls -a | lv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment