LoginSignup
0
0

More than 3 years have passed since last update.

ログインシェルについての概要まとめ

Posted at

ログインシェルとは

ログイン直後に起動するシェルのこと。

環境

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.6
BuildVersion:   19G2021

利用できるログインシェル一覧を表示

$ cat /etc/shells
# 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/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

使用中のログインシェルを表示

bash であることがわかる。

$ echo $SHELL
/bin/bash

ログインシェルの変更

zsh に変更する場合は下記のようにする。

$ chsh -s /bin/zsh
Changing shell for username.
Password for username:

再ログインすると、下記のようにデフォルトのプロンプトが % になり、ログインシェルが /bin/zsh となっていることがわかる。

username@hostname ~ % echo $SHELL
/bin/zsh

バージョンを調べる

ログインシェルが bash の場合

$ echo $BASH_VERSION
3.2.57(1)-release

ログインシェルが zsh の場合

% echo $ZSH_VERSION
5.7.1
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0