oh-my-zsh配置 alias 指定指令别名

在平时使用shell中经常要输入很长的命令是不是很头疼!那咱们就来设置一下快捷指令吧!

首先确保你已经安装过oh-my-zsh~

然后执行

vim ~/.zshrc

这时候可以看到文件底部内容为

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

那么就直接在文件底部 按照他的形式去添加就好了~

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias go-work="cd ~/Document/work"

不要忘了让刚才的命令生效,不然使用tab键无法自动补全

source ~/.zshrc

ok,接下来在你的shell中试试go-work吧~

你可能感兴趣的:(Shell,日常问题,shell,bash,oh-my-zsh,alias,linux)