Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2912

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

$
0
0

ログインシェルとは

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

環境

$ 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

Viewing all articles
Browse latest Browse all 2912

Trending Articles