How to install zsh in FreeBSD ; How to set zsh as the default shell in FreeBSD

The Z shell (zsh) is a powerfull bash compatible shell. It can easily be installed on every Linux or Unix distro.

Watch Free Movies

In this article I will install zsh in FreeBSD and PCBSD and set zsh as the default login shell.

I will show you how to install zsh in both, the ports method and with pkg_add. Use only one of this installation methods.

I recommand the installation with pkg_add because it’s easier and faster:

How to install zsh with pkg_add:

$ pkg_add -r zsh

How to install zsh from ports:

$ cd /usr/ports/shell/zsh
# make install clean

Installation finished. To use the Z shell, type zsh in your terminal.

How to set zsh as your default login shell:

Usually, when you install zsh, you want it to be your default login shell. The login shell can be changed with chsh or usermod:

$ chsh -s /usr/local/bin/zsh mike
OR: $ usermod -s /usr/local/bin/zsh mike

To set aliases, functions or customize your prompt, edit your ~/.zshrc file.

Scroll to Top