Latest web development tutorials

Linux chsh命令

Linux 命令大全 Linux命令大全

Linux chsh命令用於更改使用者shell 設定。

使用權限:所有使用者。

語法

shell>> chsh

實例

shell>> chsh
Changing fihanging shell for user1
Password: [del]
New 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
Changing shell for root.
New shell [/bin/bash]: /bin/csh //输入新的shell地址
Shell changed.

通過-s 參數改變當前的shell設置

# chsh -s /bin/csh //改变当前设置为 /bin/csh
Changing shell for root.
Shell not changed.

Linux 命令大全 Linux命令大全