Backend/Server

Linux. Shell 확인, 그리고 변경하기

out of coding 2019. 10. 30. 00:22

이전에는 크게 생각하지 않았던 문제인데, 서버 개발을 하게 되면서 쉘을 사용하는 일이 많다 보니 이런 부분들을 알아보게 되었습니다.

 

1. 설치된 Shell을 알아보는 방법

cat /etc/shells

$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/ksh
/bin/bash
...

2. 사용중인 Shell 확인

echo $SHELL

$ echo $SHELL
/bin/bash

3. Shell을 변경

chsh

$ chsh
Password: (암호 입력)
Changing the login shell for userID
Enter the new value, or press ENTER for the default
 Login Shell [/bin/sh]: /bin/bash