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.
1$ echo $0
Depending on your machine the output could be -bash
or /bin/bash
or ksh
or something else.
If the output contains the word bash
then that means you are using bash
shell.
If you are not using bash then we recommend you to switch to bash
shell.
First let's find full path to bash shell.
In most of the systems it is /bin/bash
.
Execute the following command.
1$ type -a bash
On my machine I see the following output.
1bash is /usr/local/bin/bash
2bash is /usr/local/bin/bash
3bash 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 bash
.
1$ 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.
1$ brew upgrade bash
Now open a new shell and execute the following command.
1$ bash --version
2GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin18.7.0)
If you see output 5.1.4 or higher than you are all set.