English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Linux chsh 命令用于更改用户的 shell 设置。
使用权限:所有用户。
shell>> chsh
shell>> chsh 正在更改用户1的挂起的 shell。 密码: [del] 新 shell [/bin/tcsh]: ### [是当前使用的 shell] [del] shell>> chsh -l ### 显示 /etc/shells 文件内容 /bin/bash /bin/sh /bin/ash /bin/bsh /bin/tcsh /bin/csh
更改当前的 shell。当前的 shell 设置为 //bin/bash,通过 chsh 命令,更改 shell 设置为 /bin/csh。
# chsh 正在更改 root 的 shell。 新 shell [/bin/bash]: /bin/csh //输入新的 shell 地址 Shell 已更改。
通过 -s 参数更改当前的 shell 设置
# chsh -s /bin/csh //将当前设置改为 /bin/csh 正在更改 root 的 shell。 Shell 未更改。