shell个人常用函数定义:
alias utf8-to-gbk="iconv -cf utf8 -t gbk" alias gbk-to-utf8="iconv -cf gbk -t utf8" # @usage : find-content cpp content find-content () { find ./ -name "*.$1" | xargs grep -n --color $2 ; } find-file () { find ./ -name "*.$1" | grep "$2" | awk '{print "vi\t"$0}' ;} gen-wget () { a=`hostname` b=`pwd`; echo "wget -r -nd "$a"$b"/$1 ;} gen-pwd () { a=`pwd`; echo "$a/$1" ; } gen-ftp () { hostname=`hostname` pwd=`pwd`; echo "ftp://$hostname:$pwd"/$1 ;}