Xod*_*rap 140 command-line fish
有没有办法在ubuntu上网本混音中将fish设置为默认shell?我放入了我的 .bashrc 来运行 fish,它工作正常,但是 ubuntu 将它识别为在 bash 中运行的 fish,这意味着当我尝试关闭 shell 时它会警告我一个任务仍在运行。
它不会作为新应用程序弹出,因此我无法像普通应用程序一样将其固定在我的栏中。
ajm*_*tch 200
您可以通过运行将fish设置为默认shell
chsh -s `which fish`
Run Code Online (Sandbox Code Playgroud)
要为其他用户执行此操作,只需在命令末尾添加用户名,然后使用sudo
.
然后注销并重新登录。
(要将其重新设置为bash
,您当然需要使用 Fish 语法,如下所示chsh -s (which bash)
)
swe*_*tfa 34
usermod -s /usr/bin/fish username
Run Code Online (Sandbox Code Playgroud)
但是必须以 root 身份运行。
这将永久更改指定用户的外壳。
KD1*_*100 24
我只是将这一行添加fish
到我的.bashrc
.
jac*_*avo 19
我同意chsh
是正确答案。然而:
如果你运行chsh
并得到错误
/usr/local/bin/fish: non-standard shell
Run Code Online (Sandbox Code Playgroud)
只需将鱼的二进制位置添加到/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
Run Code Online (Sandbox Code Playgroud)
然后chsh -s /usr/local/bin/fish
。