美文网首页
更换shell的几种方式

更换shell的几种方式

作者: citySouth | 来源:发表于2018-05-08 10:19 被阅读0次
查看默认shell

echo $SHELL

更换默认shell
  1. chsh -s /bin/zsh
  2. 重启terminal

有的时候以上方法会失效,比如在ubuntu bash on windows(wsl) in ConEmu中,这时可以尝试以下方法:

  1. vim ~/.bashrc
  2. 添加如下内容到 #for examples 注释下面,并保存
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi 
  1. 重启terminal

还可以更换指定用户的shell

  1. vim /etc/passwd
  2. zhou:x:1000:1000:,,,:/home/zhou:/bin/zsh

相关文章

网友评论

      本文标题:更换shell的几种方式

      本文链接:https://www.haomeiwen.com/subject/etrirftx.html