一、软件安装
# Redhat 系列执行 sudo yum install zsh # Debian 系列执行 sudo apt-get install zsh # 安装on-my-zsh wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
二、基本配置
2.1 别名配置
# ip查询 i() curl cip.cc/$1 # 天气 tq() curl wttr.in # ctrl+q 退回上层 cdlast() { cd - ls -lrth --color=auto | tail zle reset-prompt } zle -N cdlast bindkey '^Q' cdlast # 时间戳转换 ds() date -d @$1 "+%Y-%m-%d %H:%M:%S" sd() date -d "$1" +%s # 有道翻译 fanyi() { word=`echo $1 | tr -d ' ' | xxd -plain | sed 's/(..)/%1/g'` result=$(curl -s "http://fanyi.youdao.com/openapi.do?keyfrom=CoderVar&key=802458398&type=data&doctype=json&version=1.1&q=$word") echo "