What is Linux Shell? The most popular Linux Shells

Are you satisfied using the bash shell in Linux? Or do you want to try an alternative? There are tsch, fish, KornShell and Z Shell for you to choose from. But which popular Linux shell is best?

What is Linux Shell?

Usually, when you write an app, do it in human-understandable high-level language. For example: C #, Java, C ++, and so on. Believe it or not, your computer can only get messages written under the symbols 0 and 1, commonly known as binary code or machine code.

A compiler will then translate the high-level language into a binary file like an executable. This binary file is what you do to launch the aforementioned application.

Your computer is an interpreter. It is between what you ask it to do and how it does it.

Shell called the interpreter. Similar to a compiler, a user code interpreter executes it into machine code. One of the differences is that the interpreter performs sentence by sentence. Meanwhile, a compiler will scan the entire program and translate it all into machine code.

So the shell is an interface for you to interact with your operating system. When you enter commands into the shell, it is responsible for interpreting those commands. Operations like file copying, piping, listing files are all in the powers of the shell.

Several Linux Shells are available. To find out all available shells on your system, open a terminal and type:

cat /etc/shells

To find out what type of shell you are currently using:

echo $0

What is Linux Shell? The most popular Linux Shells Picture 1What is Linux Shell? The most popular Linux Shells Picture 1

But are you using the best Linux Shell? Let's see what's available.

1. Bash

This is the most popular shell among Linux users. It's hard to think of a shell without the Bourne-Again Shell (bash). Many Linux distributions have bash as the default shell, because the default GNU bash shell. Released in 1989, it had a couple of decades of strong growth.

The predecessor of Bash was The Bourne Shell (sh), which was one of the original Unix shells. An appealing feature to sh programmers is that they can directly convert their scripts to bash, completely preserved. Bash also offers a number of improvements for users:

  1. Complete the order
  2. Order history

Usually online documentation will assume you are using bash. However, it's not without flaws - anyone who has written a bash script can attest to this! Bash writing and reading is not always easy.

2. KornShell

What is Linux Shell? The most popular Linux Shells Picture 2What is Linux Shell? The most popular Linux Shells Picture 2

More commonly known as ksh, KornShell is a popular alternative Linux Shell that originated in Bell Labs back in the 80's. There isn't much of a difference between bash and ksh, but each has minor advantages over the other. . Ksh, for example, has the old new cd command. If you are in / Downloads / foo / bar / one / foobar, if you need to go to / Downloads / foo / bar / two / foobar, just enter:

cd one two

The benefits of ksh include:

  1. Better loop syntax
  2. Natural ways of repeating commands
  3. Array of association

Unlike bash, it is difficult to find help for ksh online. If you want to try ksh, enter:

sudo apt install ksh ksh

3. Tcsh

What is Linux Shell? The most popular Linux Shells Picture 3What is Linux Shell? The most popular Linux Shells Picture 3

Tcsh can be traced back to the early days of Unix. This is an improved version of the C shell (csh) and has the following features:

  1. Programmable command line completion
  2. Command line editing
  3. Add arguments to the alias
  4. Easy command history access

You can run any command by typing! N replace n with its corresponding number in the display history. Complete the history tab in tcsh working by typing:

!a

This expands to the last command that starts with the letter 'a'. Similarly, in bash, you would have to type! A: p to see the first command followed by !! to do it.

To try tcsh, enter:

sudo apt install tcsh tcsh

Tcsh is the default shell for BSD-based systems like FreeBSD. The big attraction of tcsh is its scripting language, which is useful for anyone programming mainly in C language.

4. Fish

What is Linux Shell? The most popular Linux Shells Picture 4What is Linux Shell? The most popular Linux Shells Picture 4

In all seriousness of Linux, the fish development team came up with a humorous project. On their website the title says 'Finally, a command line shell for the 90s' although fish ( f riendly i nteractive sh ell) was developed in 2005. In addition to the 'Glorious VGA Color' welcome , fish also has several enhancements over other shells:

  1. Commands with invalid syntax are displayed in red
  2. The correct syntax will display in blue
  3. Autocomplete proposal
  4. Complete the command based on the man page on your device

This feature adds the syntax from the man page of newly installed software to your autocomplete suggestions. If you want to get more familiar with the command line, fish is a great place to start.

Type the following line to try out fish:

sudo apt install fish fish

5. Z Shell

What is Linux Shell? The most popular Linux Shells Picture 5What is Linux Shell? The most popular Linux Shells Picture 5

Zsh shares similarities with bash and ksh, incorporating many of the features found in tcsh. Features of Zsh include:

  1. Navigable autocomplete list
  2. Fix outstanding spelling errors
  3. Complete the command line
  4. History is shared across terminals
  5. Globbing (the wildcard for the filename)

Globbing in zsh is very helpful. Type:

vim /u/l/b/a

Open the file:

/usr/local/bin/autoupdate.sh

Zsh may take a while to configure on first use if you are not using the default configuration. To try it out, enter:

sudo apt install zsh zsh
5 ★ | 1 Vote