What is Linux Shell? The most popular Linux Shells
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
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:
- Complete the order
- 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
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:
- Better loop syntax
- Natural ways of repeating commands
- 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
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:
- Programmable command line completion
- Command line editing
- Add arguments to the alias
- 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
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:
- Commands with invalid syntax are displayed in red
- The correct syntax will display in blue
- Autocomplete proposal
- 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
Zsh shares similarities with bash and ksh, incorporating many of the features found in tcsh. Features of Zsh include:
- Navigable autocomplete list
- Fix outstanding spelling errors
- Complete the command line
- History is shared across terminals
- 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
You should read it
- Everything you can do with the new Windows 10 Bash Shell
- What is 'Bash' in Linux?
- How to change user accounts in Ubuntu Bash Shell Windows 10
- How to create and open folders in VS Code with Git Bash for Windows
- How to use Zsh (or other Shells) on Windows 10?
- 5 best command line emulation software for Windows 10
- Instructions for accessing Ubuntu Bash files on Windows
- Ubuntu Bash tutorial on Windows 10
- Difference between Zsh and Bash
- How to display the date and time in Linux Terminal
- Forget the GUI, the Command Line is returning
- How to create and run a shell script in Ubuntu 20.04 LTS
Maybe you are interested
Should I use PowerShell or Command Prompt?
This PowerShell script can bypass Windows 11 system requirements, Microsoft Account
How to execute Shell script in Linux
Windows PowerShell Could Allow Viruses to Infiltrate Undetected
PowerShell and everything you need to know about it
Why do shrimp and crab shells turn red after cooking?