LoginSignup
3
5

More than 5 years have passed since last update.

macで標準shellをzshにする方法

Last updated at Posted at 2019-04-05

この度、shellをzshにして、作業効率アップアップ(?)したので、備忘録

bash

# zshの場所を確認
$ which zsh
>> /bin/zsh

# 以下のコマンドを実行
$ chsh -s /bin/zsh 
$ export SHELL=/bin/zsh
$ exec $SHELL -l

変えたら、標準がpython2になったり、pipでインストールしたパッケージ類が使えなくなるので、以下を実行.
zshにも同じpathを指定すれば使えます。

zsh
# .zsh_profileを作成して編集
$ vi ~/.zsh_profile
.zsh_profile
# 以下を追加
if [ -d $HOME/.anyenv ] ; then
    export PATH="$HOME/.anyenv/bin:$PATH"
    eval "$(anyenv init -)"
fi
export PATH="$HOME/.pyenv/shims:$PATH"
zsh
# 更新する
$ source ~/.zsh_profile

追記

.zshrc にsource ~/.zsh_profileを追加しないと、ターミナルを起動する度、毎回このコードを入力する羽目になる.

3
5
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
3
5