Post

Linux change default shell

Linux change default shell

Linux change default shell

When I set up a new machine or a new user, changing from bash to zsh is one of the first things I do. chsh does it properly — it updates /etc/passwd so the change is permanent and applies to all login sessions, not just the current terminal.

Changing my shell to zsh

  • Check if I have zsh installed
1
2
3
4
$ which zsh

/usr/bin/zsh

  • Verify current logged-in user
1
2
3
$ whoami

testing
  • Change shell for current logged-in user to zsh
1
2
3

$ sudo chsh -s $(which zsh) $(whoami)

This post is licensed under CC BY 4.0 by the author.