Switching your terminal to ZSH

written at: 2024-06-21

In order to use ohmyzsh it is neccesary to switch to the zsh shell. On a Mac it is the default shell as far as i recollect, but switching is quite easy. Some advantages of using zsh with ohmyzsh are command autocompletion and better integration with git.

Just input the following command in your terminal app:

chsh -s /bin/zsh

Or, to go back to bash:

chsh -s /bin/bash

In theory, it is also quite easy on a debian like distro, such as Ubuntu or PopOS. To make sure it is installed, use the following command:

sudo apt install zsh -y

You can use the same command to change the default shell as for the Mac (above/chsh command). The other option is to edit the passwd file. It is located in '/etc/passwd':

sudo nano /etc/passwd

Find the line near the bottom where your username is at the start of the line. It should end with your prefered shell.

Change this (or comment the line and copy it):

bart:x:1000:1000:Bart:/home/bart:/bin/bash

To:

bart:x:1000:1000:Bart:/home/bart:/usr/bin/zsh

Now close your terminal app and re-open. You should be fine now. If not, reboot to be sure. Use the following command to show which shell you are using:

echo $0

That should be it!