linux - 在 Linux 中更改默认 shell

标签 linux bash shell environment tcsh

如何更改默认 shell ? env 命令当前说:

SHELL=/bin/tcsh

我想把它改成 Bash。

最佳答案

试试linux命令chsh

详细的命令是chsh -s/bin/bash。 它会提示您输入密码。 您的默认登录 shell 现在是 /bin/bash您必须退出并重新登录才能看到此更改。

以下内容来自手册页:

The chsh command changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for her own account, the superuser may change the login shell for any account

此命令将永久更改默认登录 shell。

注意:如果您的用户帐户是远程的,例如 Kerberos 身份验证(例如 Enterprise RHEL),那么您将无法使用 chsh

关于linux - 在 Linux 中更改默认 shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13046192/

相关文章:

c - 将错误写入文件

Linux非法日期格式

linux - 如何检索处于可中断 sleep (S+)或其他状态的进程?

linux - 如何递归列出所有文件和目录

linux - 检查目录是否不存在

c++ - 是否可以在 linux 裸机服务器中使用 C/C++ GUI 应用程序?

c - 有没有办法在不读取 linux 上的 proc/sys 文件的情况下获取电池信息(状态、插入等)?

当我通过 USB 集线器连接串行设备时,Linux 进程进入 D 状态

linux - 如何在 linux shell 中存储 nproc 返回的值?

bash - 如何在变量中存储标准错误