Z-Shell on Free BSD

The installation process is very simple. Simply login to the super user account and type in your root password. Finally install the Z-Shell by typing in the following command.

You will of course need to confirm with a “yes”. The following is the full output of the Z-Shell installation.

Now that you have it installed, you need to set it up to be used as your shell of choice. I don’t want to set it up as the system-wide default, since I don’t want to change the way FreeBSD works for everyone. Therefore I will only change it for my user account. To do this, I need to create two files in my home folder. The two files are zshrc and zprofile. There are actually 4 configuration files, if you want you can read up on them at freecodecamp. However, we will just use the best practices of using profile to set the environment variables PATH and EDITOR. We will use zshrc for aliases, custom prompts and tweaking the terminal aesthetics.

So to set the shell for your login. You will use the chsh command. This command is the change shell command. It is one of several commands used to change the user database information.

The -s option sets a new shell for the user freebsd. The path is the location of the zsh executable.

The next time you login, the account will start with the z-shell, and will give the following prompt.

I suggest choosing option (0). You then get the following information incase you wish to run the z-shell configuration again.

You can then edit the ~/.zshrc file to set up your preferences for terminal appearance. You can edit the command prompt to include the user name @ machine name present working director and prompt by entering the following command.

You can then reload your prompt by reloading the zshrc file.

Your prompt will now appear like this and you are ready to use the Z-shell.

Join the ConversationLeave a reply

Your email address will not be published. Required fields are marked *

Comment*

Name*

Website