How to change your default Shell?

🐚 The art of shell-hopping

How to change your default Shell?

When you get into the Linux world, you understand something crucial: you must learn how to use the terminal. And with that, how to use Bash (the default Linux shell) and when you dive deep into some concepts and technologies, you realize that there are a lot of different shells. And how can you test them? How to change your default shell?

🐚 What is the shell?

The Shell is the program that processes your inputs and commands, and returns an output. It's a powerful tool that allows us to make a complex tasks with just some commands on the terminal. We can manage even a text editor on them (Look at vim for example).

And there are a lot of shells out there, made in a lot of different languages. But there are three above the rest. Bash (the default one), Zsh (the power one) and Fish (the friendly one).

Bash

The default one. Almost every distribution out there has this shell on their terminal, even macOS had it until Mojave. It makes everything good, nothing too special. And for someone like us that want to test and learn is not an option to only keep using it until the end. And some users use it because it's not bloated though it's a little bit more slow than the next one:

Zsh

Pretty similar to Bash but with more speed things change so much. And not only that. Zsh also has a lot of other cool features, including spelling correction, and a big community that makes a lot of frameworks like Oh My Zsh.

Fish

Fish means Friendly Interactive Shell and makes a lot of sense when you get to use it. With an incredible human-computer interaction including a lot of cool functions that zsh and bash has, it can also make tab completion and has syntax highlighting (something incredible if you want to know if you misspelled some command) and is also highly customizable!

🌱 Only want to test

If you only want to test on of the shells out there you can just type into your terminal the command of that particularly shell. In case you want to test zsh you need to write zsh or fish if you want to test that one in your terminal. And I would totally encourage you to try them all in this way, so you can check which one you would choose for your daily use.

🚀 I'm sure this one will be my default shell

Now for you to change your default shell you'll need to follow different steps (in order of which operating system you're):

Debian and Ubuntu based distributions

# Check the shells you have on your system.
# This will bring you a list of locations of your shells:
cat /etc/shells

# Change to your choice:
chsh -s 'one of the list'
# For example: chsh -s /bin/bash

Arch based distributions

# Check the shells you have on your system.
# This will bring you a list of locations of your shells:
chsh -l

# Change to your choice:
chsh -s 'one of the list'
# For example: chsh -s /bin/bash

As a conclusion, I'd invite you to try out all the shells. Maybe you'll find your new best friend there! (my favorite is Fish!) also you'll learn a lot about the terminals and commands on the way!