Samir Parikh / Blog


Originally published on 27 December 2018

My first experience with Linux introduced me to the Bash shell so it's the one I'm most comfortable with. By default, FreeBSD comes with the tcsh(1) shell which is a perfectly capable shell. However, old habits die hard so here is how you can install the bash(1) shell following the FreeBSD Handbook.

NOTE: You should never change the default shell of the root user. To avoid doing this, we will perform the following steps as a normal user and escalate our privilege with sudo. Please see the FreeBSD Quickstart Guide for Linux Users for more information.

Install bash:

$ sudo pkg install bash

Change your shell:

$ chsh -s /usr/local/bin/bash

The next time you log in, the bash shell will be automatically started.

$ echo $SHELL
/usr/local/bin/bash
$ echo $0
-bash