These days Mac laptops come with zsh as the default shell. Your linux machine might be configured to have a different default shell. At BigBinay we recommend everyone to use bash shell.
In order to find out what shell you are currently execute the following command.
$ echo $0
Depending on your machine the output could be
ksh or something else.
If the output contains the word
bash then that means you are using
If you are not using bash then we recommend you to switch to
First let's find full path to bash shell.
In most of the systems it is
Execute the following command.
$ type -a bash
On my machine I see the following output.
bash is /usr/local/bin/bash bash is /usr/local/bin/bash bash is /bin/bash
This confirms that
/bin/bash is where bash shell executable resides.
All shells provide a command called
chsh. It stands for "change shell".
Execute the following command to change default shell to
$ chsh -s /bin/bash
System will prompt you for a password. Enter your password. In most of the systems as you type the password there will not be any feedback. This feels strange but don't worry. Just type your password and hit enter.
Quit the shell you are using and start a new shell.
If you are using a mac then start a new terminal and then execute
echo $0 and
this time you should see
bash in the output.
The new Mac laptops use zsh as the default shell. However Mac laptops contain bash shell too. The bash shell is not the default shell.
The bash shell that is shipped by Apple are stuck at version 3.x because of the licensing concerns. The latest version of bash is 5 or even higher.
Execute the following command to upgrade bash on your Mac laptop.
$ brew upgrade bash
Now open a new shell and execute the following command.
$ bash --version GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin18.7.0)
If you see output 5.1.4 or higher then you are all set.