Skip to content

Instantly share code, notes, and snippets.

@fanlushuai
Last active January 25, 2021 02:01
Show Gist options
  • Save fanlushuai/671dfa35fd6cb56014459d48664c404e to your computer and use it in GitHub Desktop.
Save fanlushuai/671dfa35fd6cb56014459d48664c404e to your computer and use it in GitHub Desktop.
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
alias la='ls -a --color=auto'
alias ll='ls -al --color=auto'
alias rzsh='source ~/.zshrc'
alias vzsh='vim ~/.zshrc'
# make ping support for http://www.example.com/xx/yyy.html
alias ping='ping_pro(){\
local PING_PARAMS=${@:1:$# -1};\
local PING_TARGET=$( echo ${@:$#} | sed "s/\(http:\/\/\|https:\/\/\)//;s/\/.*//" );\
ping $PING_PARAMS $PING_TARGET\
};\
ping_pro'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment