Change default shell in Linux

Linux Shell

In Unix/Linux world, shell is a very important part of an operating system. So what exactly this shell is?

The Shell is a programming layer, an interface, which understands and accepts/executes commands, string of texts a user type in to perform tasks.

According to Wikipedia:

“A Unix shell is a command-line interpreter or shell that provides a traditional Unix-like command line user interface. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute, or by creating text scripts of one or more such commands.”

There are various kinds of shells for different purposes some of which are mentioned in the upcoming section of this article. Most Unix/Linux systems use BASH (Bourne again Shell) as the default shell. “BASH” is successor of “Borune Shell” (SH) which was written in 1989.

Types of shells:

  • sh (Bourne Shell): One of the first shells to be created ever. It was created by Stephen Borune.
  • bash (Bourne again Shell): Based on “sh” and is used widely as default shell till date. Creator: Brian Fox.
  • ksh (Korn Shell): Created by David Korn, this shell adds more features to sh and bash.
  • zsh (Z Shell): Create by Paul Falstad, this shell is fairly advanced than sh and bash as it adds much more to the shell.

No matter what flavor of Linux is it, default shell can always be changed. In order to check what shell is being used currently, run:

$ echo $0

 

Output of this command will provide the name of default shell that is currently being used on your system. Secondly, check what shells are available on Linux operating system by running:

$ chsh -l

 

This command will provide full paths to the installed shell packages on your system. In order to change the shell, for example, from “bash” to “zsh”, run:

$ chsh -s PATH_TO_SHELL

 

Change “PATH_TO_SHELL” to the full path of shell provided by “chsh -l”. Once changed, re-login into your account and you will be greeted by the new shell.

There are different kinds of shells targeting different users and different expert levels. Tell us what is your favorite shell in the comments section below.

Leave a Reply

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