如何将fish设置为默认shell?
有没有办法将fish设置为ubuntu netbook remix中的默认shell? 我放入我的.bashrc来运行fish,它运行正常,但ubuntu将其识别为在bash中运行的鱼,这意味着当我尝试关闭shell时它会警告我任务仍在运行。
它不会弹出一个新的应用程序,所以我不能像普通的应用程序一样将它固定到我的酒吧。
您可以通过运行将fish设置为默认shell
chsh -s `which fish`
要为其他用户执行此操作,只需在命令末尾添加用户名,然后使用sudo
。
然后注销并重新登录。
(要将其设置回bash
,你需要使用Fish语法,比如这个chsh -s (which bash)
)
usermod -s /usr/bin/fish username
必须以root身份运行。
这将永久更改指定用户的shell。
我刚刚将线fish
添加到.bashrc
的末尾。
我同意chsh
是正确的答案。 然而:
如果你运行chsh
并得到错误
/usr/local/bin/fish: non-standard shell
只需将鱼二进制位置添加到/etc/shells
。
在这里找到。
在/etc/shells
,添加/usr/local/bin/fish
:
# List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh /usr/local/bin/fish
然后chsh -s /usr/local/bin/fish
。