1. zsh和oh-my-zsh安装
参考链接:
https://github.com/robbyrussell/oh-my-zsh/wiki/Installing-ZSH
https://github.com/robbyrussell/oh-my-zsh
$ sudo apt-get install zsh
$ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
$ chsh -s $(which zsh)
$ chsh -s /bin/zsh
注销并重新启动终端即可.
2. 切换zsh和base shell
切换回bash
$ chsh -s /bin/bash
或
$ chsh -s $(which bash)
注销并重新启动终端即可.
p.s.
bash与zsh的切换实际在文件/etc/passwd里的xx:x:1000:1000:xx:/home/xx:/bin/bash
与xx:x:1000:1000:xx:/home/xx:/usr/bin/zsh
的切换
3. 常见问题解决
zsh: command not found: workon
解决方法如下:
$ vim .bash_profile
:
export PATH=/bin:/usr/bin:/usr/local/bin:$PATH
激活virtualenvwrapper
, 使workon
命令生效:
$ source .bash_profile
$ echo source ~/.bash_profile >> ~/.zshrc
$ echo source /usr/local/bin/virtualenvwrapper.sh >> ~/.zshrc
$ source /usr/local/bin/virtualenvwrapper.sh