Unix Shells Compared- Every Shell Ever Compared

Introduction

In this article, we shall take a look at some of the top most used open-source and proprietary Linux GNU / UNIX shells. The shell is the command interpreter in an OS, it is a program triggered via a terminal that executes other programs. It provides a user an interface to the Unix/GNU Linux system so that the user can run different commands or utilities/tools with some input data.

When the shell has finished executing a program, it sends an output to the user, in most modern GUI or UI based OS, the screen alongside other optionally configurable output methods like logs, data streams, feeds, prints, etc. For this reason, it is referred to as the “command interpreter”. The shell is much more than just a command interpreter, it is also a programming language of its own with complete programming language constructs such as conditional execution, loops, variables, functions and many more. That is why the Linux GNU / UNIX shell is more powerful compared to the Windows shell.

List of tested and surveyed shells (indexed in alphabetical for list)

  • Z Shell (zsh)
  • Almquist shell (ash)
  • Bourne Again Shell (bash 1977)
  • Bourne Again Shell (bash v4)
  • Bourne Again Shell (bash v4.3)
  • C Shell (csh)
  • Friendly Interactive Shell (fish)
  • Ion Shell
  • Korn Shell (ksh-ksh93t+)
  • Portable Operating System Interface Shell (POSIX)
  • Public Domain Korn Shell (pdksh)
  • Run Command Shell (rc)
  • Scheme Shell (Scsh)
  • Tenex C Shell (tcsh)
  • Thompson Shell
  • Z Shell (zsh)

Terminal Shells: History

Unix RankingOverall RankingShellDefault script shell inDefault login shell inUsually invokedLicenseStartup/shutdown scriptsIntroduced
11zshUnix (Grml, macOS 10.15+)Unix (Deepin, GoboLinux, Grml, macOS 10.15+)zshMIT1 (system and user's zshenv, zprofile, zshrc, zlogin, zlogout)1990
23bash (v4)Unix - Mac (GNU, Linux, Haiku, macOS 10.3–10.14)Unix - Mac (GNU, Linux (default for root), macOS 10.3–10.14)bash, shGPL1 (/etc/profile, .bash_profile, .bash_login, .profile, .bashrc)1989
34ksh (ksh93t+)Unix (OpenSolaris)Unix (AIX, HP-UX)kshCPL1 (system and user's profile and kshrc)1988
47fishUnix (?)Unix (GhostBSD)fishGPL1 (/etc/fish/config.fish and ~/.config/fish/config.fish)2005
58tcshUnix - Mac (?)Unix - Mac (FreeBSD (default for root), formerly Mac OS X)tcsh, cshBSD1 (/etc/csh.cshrc, /etc/csh.login, ~/.tcshrc, ~/.cshrc, ~/.history, ~/.login, ~/.cshdirs)1983
610cshUnix (?)Unix (Su0S)cshBSD1 (~/.cshrc, ~/.login, ~/.logout)1978
711pdkshUnix (OpenBSD[15])Unix (OpenBSD[15])kshPublic Domain1 (/etc/profile, .profile)1989
813ashUnix (NetBSD, Minix, BusyBox based systems)Unix (Minix, BusyBox based systems)shBSD1 (/etc/profile, .profile)1989
914Bourne shell current versionUnix (Su0S-5.x)Unix (Su0S-5.x, FreeBSD (0n-root user)[4])shCDDL1 (.profile)1977
1016POSIX shell[6]Unix (POSIX)Unix (-)sh--1992
1117rcUnix (Plan 9, Version 10 Unix)Unix (Plan 9, Version 10 Unix)rcLucent Public License-1989
1218ScshUnix (?)Unix (?)scshBSD-1994
1320Bourne shell 1977 versionUnix (7th Ed. UNIX,)Unix (7th Ed. UNIX)shProprietary1 (.profile)1977
1423IonUnix (Redox)Unix (Redox)ionMIT1 (~/.config/ion/initrc)2015
1526Thompson shellUnix (UNIX)Unix (UNIX)sh--1971

Unix Shells Ranking: Programming/Development Utilities

ShellException handlingFunctionsArith­meticeval func­tionFloating pointMath function libraryLinear arrays or listsPseudo­random number generationSearch & replace on variable substi­tutionsBytecodeAssoc­iative arraysLambda functions 
PowerShell11111111111112
zsh11111111111011
ksh (ksh93t+)11111111111011
bash (v4)1111001110108
4DOS, NDOS1111--1111008
Hamilton C shell0111111110008
fish1111111100008
TCC (formerly 4NT)1111--1111-08
BeanShell1111--11-1108
Scsh-1-1--1111-17
pdksh1111001100006
VMS DCL[20]1110011000005
Windows CMD.EXE[nb 5]0110001110005
ash1111000000004
Bourne shell current version1111000000004
tcsh0011001010004
csh0011001010004
POSIX shell[6]1111000000004
rc11-1--1000-04
Bourne shell 1977 version1001000000002
4OS2---1---1---02
COMMAND.COM1000000000001
Ion0
CCP-000--0000000
OS/2 CMD.EXE00-000-000000
Thompson shell0

Unix Shells Ranking: Security Enhancements

ShellFile/directory passwordsSecure (password) promptRestricted shell subsetExecute permissionSafe data subsetEncrypted variables/ parametersUntrusted script blocking 
PowerShell01101115
VMS DCL[20]01110003
4DOS, NDOS11010003
COMMAND.COM11010003
zsh-1100002
bash (v4)-1100002
ksh (ksh93t+)-1100002
ash-1100002
Bourne shell current version-1100002
tcsh-1100002
csh-1100002
pdksh-1100002
Bourne shell 1977 version-1100002
fish-110-002
rc-1100002
TCC (formerly 4NT)01000001
POSIX shell[6]-1000001
Scsh-1000001
Ion0
Hamilton C shell00000000
4OS20-000000
Windows CMD.EXE[nb 5]00000000
BeanShell-------0
CCP00000000
OS/2 CMD.EXE00000000
Thompson shell0

Unix Shells Ranking: String and Multi string Utilities

ShellString processingAlternation (Brace expansion)Pattern matching (filename globbing)Recursive globbing (generating files from any level of subdirectories)Globbing qualifiers (filename generation based on file attributes)Pattern matching (regular expressions built-in) 
zsh1111116
bash (v4)1111015
ksh (ksh93t+)1111015
fish1111015
TCC (formerly 4NT)1011115
4DOS, NDOS1011104
tcsh1110014
Hamilton C shell1111004
Windows CMD.EXE[nb 5]1011104
VMS DCL[20]1011003
PowerShell101--13
csh1110003
Bourne shell current version1010002
pdksh-110002
POSIX shell[6]1010002
Scsh--10012
OS/2 CMD.EXE0010102
ash--10001
Bourne shell 1977 version-010001
COMMAND.COM0010001
rc--10001
BeanShell-----11
Ion0
4OS2-0---00
CCP0000000
Thompson shell0

Unix Shells Ranking: Inter-Process Communication

RankShellCommand substitutionSubshellsProcess substitutionKeystroke stackingTCP/UDP connections as streamsCommand historyValue promptMenu/options promptColored directory listingsText highlightingCommand name completionPath completionCommand argument completionWildcard completionDirectory history, stack or similar featuresImplicit directory changeIntegrated environmentContext sensitive helpCommand builderAutomatic suggestionsSyntax highlightingAuto­correctionMandatory argument promptSnippetsProgress indicator 
1zsh111011111111111101011101020
2PowerShell110-11110011111011111111120
3TCC (formerly 4NT)11-111111011111111001000017
44DOS, NDOS11-101111011111111100000016
5bash (v4)111011111111111100000000015
6fish100001110011111110011100014
7ksh (ksh93t+)111011111111001000000000012
8tcsh110001101111101100000100012
9csh110001101111001100000000010
10pdksh11000111111100000000000009
11Hamilton C shell110-0110001101100000000008
12ash11000111110000000000000007
13POSIX shell[6]11000110110000100000000007
14Windows CMD.EXE[nb 5]11000110001100100000000007
15VMS DCL[20]11001110000000000000001006
16Bourne shell current version00000110110100100000000006
174OS2---10100100000110100000006
18rc111-0100001100000000000006
19Bourne shell 1977 version11000010000000000000000003
20BeanShell----1000001100000000000003
21OS/2 CMD.EXE0-000100001100000000000003
22Scsh---01010000000000000000002
23COMMAND.COM01000000000000000000000001
24Ion--------------------0
25CCP00000000000000000000000000
26Thompson shell000000000000000000000

Unix Shells Ranking: Basic/General Characteristics

ShellISO 8601 supportindependent single executableSource code availabilityLoggingConsole redirectionStream redirectionConfigurabilityPlatform-independentUnicode supportMouse support 
zsh111111111110
bash (v4)11111111109
ksh (ksh93t+)11111111109
VMS DCL[20]10111111119
4DOS, NDOS11111110018
ash-1111111108
Bourne shell current version-1111111108
Ion1111-1111-8
PowerShell10110111118
tcsh-1111111108
csh-1111111007
Hamilton C shell11011111007
pdksh-1111111007
Bourne shell 1977 version-1101111006
fish--11-1111-6
TCC (formerly 4NT)10010110116
POSIX shell[6]---11110105
4OS20-110110004
COMMAND.COM01001110004
rc-1---1-11-4
Scsh-11--1-1--4
Windows CMD.EXE[nb 5]01000110104
BeanShell-0---1-11-3
CCP01100000002
OS/2 CMD.EXE010001-0002
Thompson shell--1-1--0002

Summarised Unix Shells Ranking

Unix RankingRankingShellDefault script shell inDefault login shell inUsually invokedUsual environmentPipesLicenseBatch scriptsStartup/shutdown scriptsIntroducedISO 8601 supportavailable as statically linked, independent single file executableSource code availabilityLoggingConsole redirectionStream redirectionConfigurabilityPlatform-independentUnicode supportMouse supportCommand substitutionSubshellsProcess substitutionKeystroke stackingTCP/UDP connections as streamsCommand historyValue promptMenu/options promptColored directory listingsText highlightingCommand name completionPath completionCommand argument completionWildcard completionDirectory history, stack or similar featuresImplicit directory changeIntegrated environmentContext sensitive helpCommand builderAutomatic suggestionsSyntax highlightingAuto­correctionMandatory argument promptSnippetsProgress indicatorException handlingFunctionsArith­meticeval func­tionFloating pointMath function libraryLinear arrays or listsPseudo­random number generationSearch & replace on variable substi­tutionsBytecodeAssoc­iative arraysLambda functionsFile/directory passwordsSecure (password) promptRestricted shell subsetExecute permissionSafe data subsetEncrypted variables/ parametersUntrusted script blockingString processingAlternation (Brace expansion)Pattern matching (filename globbing)Recursive globbing (generating files from any level of subdirectories)Globbing qualifiers (filename generation based on file attributes)Pattern matching (regular expressions built-in)Total
11zshUnix (Grml, macOS 10.15+)Unix (Deepin, GoboLinux, Grml, macOS 10.15+)zshPOSIXbytes concurrentMIT1 (Unix feature)1 (system and user's zshenv, zprofile, zshrc, zlogin, zlogout)199011111111111110111111111111010111010111111111110-11000011111149
23bash (v4)Unix - Mac (GNU, Linux, Haiku, macOS 10.3–10.14)Unix - Mac (GNU, Linux (default for root), macOS 10.3–10.14)bash, shPOSIXbytes concurrentGPL1 (Unix feature)1 (/etc/profile, .bash_profile, .bash_login, .profile, .bashrc)198911111111101110111111111111000000000111100111010-11000011110139
34ksh (ksh93t+)Unix (OpenSolaris)Unix (AIX, HP-UX)kshPOSIXbytes concurrentCPL1 (Unix feature)1 (system and user's profile and kshrc)198811111111101110111111110010000000000111111111110-11000011110139
47fishUnix (?)Unix (GhostBSD)fishPOSIXbytes concurrentGPL1 (Unix feature)1 (/etc/fish/config.fish and ~/.config/fish/config.fish)2005--11-1111-1000011100111111100111000111111110000-110-0011110135
58tcshUnix - Mac (?)Unix - Mac (FreeBSD (default for root), formerly Mac OS X)tcsh, cshPOSIXbytes concurrentBSD1 (Unix feature)1 (/etc/csh.cshrc, /etc/csh.login, ~/.tcshrc, ~/.cshrc, ~/.history, ~/.login, ~/.cshdirs)1983-1111111101100011011111011000001000001100101000-11000011100130
610cshUnix (?)Unix (Su0S)cshPOSIXbytes concurrentBSD1 (Unix feature)1 (~/.cshrc, ~/.login, ~/.logout)1978-1111111001100011011110011000000000001100101000-11000011100026
711pdkshUnix (OpenBSD[15])Unix (OpenBSD[15])kshPOSIXbytes concurrentPublic Domain1 (Unix feature)1 (/etc/profile, .profile)1989-1111111001100011111110000000000000111100110000-110000-1100026
813ashUnix (NetBSD, Minix, BusyBox based systems)Unix (Minix, BusyBox based systems)shPOSIXbytes concurrentBSD1 (Unix feature)1 (/etc/profile, .profile)1989-1111111101100011111000000000000000111100000000-110000--100022
914Bourne shell current versionUnix (Su0S-5.x)Unix (Su0S-5.x, FreeBSD (0n-root user)[4])shUNIX-CDDL1 (Unix feature)1 (.profile)1977-1111111100000011011010010000000000111100000000-11000010100022
1016POSIX shell[6]Unix (POSIX)Unix (-)shPOSIXbytes concurrent-1 (Unix feature)-1992---11110101100011011000010000000000111100000000-10000010100019
1117rcUnix (Plan 9, Version 10 Unix)Unix (Plan 9, Version 10 Unix)rcPOSIXtext concurrentLucent Public License--1989-1---1-11-111-01000011000000000000011-1--1000-0-110000--100017
1218ScshUnix (?)Unix (?)scshPOSIXtext concurrentBSD--1994-11--1-1-----0101000000000000000000-1-1--1111-1-100000--100116
1320Bourne shell 1977 versionUnix (7th Ed. UNIX,)Unix (7th Ed. UNIX)shUNIXbytes concurrentProprietary1 (Unix feature)1 (.profile)1977-1101111001100001000000000000000000100100000000-110000-0100014
1423IonUnix (Redox)Unix (Redox)ionUNIXMIT11 (~/.config/ion/initrc)20151111-1111---------------------8
1526Thompson shellUnix (UNIX)Unix (UNIX)shUNIX---1971--1-1--000000000000000000000002
25CCPCP/M, MP/M (CP/M, MP/M)CP/M, MP/M (CP/M (0 login), MP/M)(CCP)CP/M, MP/M-Freeware1 (only via external SUBMIT)1 (automatic via $$$.SUB)197601100000000000000000000000000000000-000--00000000000000000002
214OS2OS/2 (Optional)OS/2 (Optional)4OS2OS/2text concurrentFreeware1 (via CALL command)1 (automatic via 4START.CMD/4START.BTM as well as 4EXIT.CMD/4EXIT.BTM files, or explicitly via /K startup.cmd option)19920-11011000---1010010000011010000000---1---1---00-00000-0---012
24OS/2 CMD.EXEOS/2 (OS/2)OS/2 (OS/2)CMDOS/2text concurrentIBM-EULA1 (via CALL command)1 (only via /K startup option)1987010001-0000-0001000011000000000000000-000-0000000000000010107
12VMS DCL[20]VMS (VMS)VMS (VMS)Automatically for login/interactive processOpenVMStext concurrentProprietary11 (SYS$MANAGER:SYLOGIN.COM and user defined LOGIN.COM)197710111111111100111000000000000000100111001100000011100010110026
22COMMAND.COMWindows (DOS, Windows 95, 98, SE, ME)Windows (DOS, Windows 95, 98, SE, ME)CMDDOStext sequential temporary filesBSD1 (via CALL command)1 (automatic \AUTOEXEC.BAT for primary shell, or explicitly via /P, /P:filename.bat or /K startup options)198001001110000100000000000000000000000100000000000110100000100010
54DOS, NDOSWindows (Optional)Windows (Optional)4DOS, NDOSDOStext sequential temporary filesMIT1 (via CALL command)1 (automatic \AUTOEXEC.BAT for primary shell and 4START.BTM/4START.BAT as well as 4EXIT.BTM/4EXIT.BAT for any shell, or explicitly via /P, /P:dir\filename.ext or /K startup options)1989111111100111-10111101111111110000001111--111100110100010111039
6TCC (formerly 4NT)Windows (optional)Windows (optional)TCCWin32text concurrentShareware1 (via CALL command)1 (automatic via registry and TCSTART/4START as well as TCEXIT/4EXIT, or explicitly via /K startup option)1993100101101111-11111101111111100100001111--1111-0010000010111137
9Hamilton C shellWindows (Optional)Windows (Optional)cshWin32bytes concurrentProprietary1 (command line option)1 (via login.csh, startup.csh and logout.csh)19881101111100110-011000110110000000000011111111000000000011110027
15Windows CMD.EXE[nb 5]Windows (Windows NT, 2000, XP, Server 2003, Vista)Windows (Windows NT, 2000, XP, Server 2003, Vista)CMDWin32text concurrentMS-EULA1 (via CALL command)1 (automatic via registry, or explicitly via /K startup option)199301000110101100011000110010000000000011000111000000000010111020
2PowerShellWindows (Windows Server 2008, 7)Windows (Windows Server 2008, 7, Vista, XP[nb 7])PowerShell.NETobjects concurrentMIT1 (PowerShell feature)1 (%USERPROFILE%\Documents \WindowsPowerShell\Microsoft.PowerShell_profile.ps1)20061011011111110-1111001111101111111111111111111110110111101--148
19BeanShell-Java-LGPL--2005-0---1-11-----1000001100000000000001111--11-110------------115

Feature-based Ranking

1. Zsh Shell (alias Z SHell)

The Unix shells listed so far were created mostly in 1970. Computers have gone a long way since, and this demands new shells, too. The most features shell among the shell enthusiasts community among the more modern shells is the Z shell or Zsh. It was created by Paul Falstad in 1990.

Zsh was designed to be interactive and it incorporates many features of other Linux GNU/ Unix shells such as bash, tcsh, and ksh. It is also a powerful scripting language just like the other shells available. 

Pros:
  • Filename generation
  • Startup Files
  • Login/logout Watching
  • Closing Comments
  • Concept Index
  • Variable Index
  • Functions Index
  • Key Index
  • Built-in Programming Features Like Bytecode
  • Support For Scientific Notation In Syntax
  • Floating-point Arithmetic

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

unix shells - z shell installation

2. Bash Shell (alias Bourne Again SHell) and BSH (alias Bourne SHell, SH)

The Bourne shell, named after its creator Stephen Bourne, was one of the first shells ever. It is the original basis on which Bash was designed and built on. It serves as the default shell on many popular Linux distros.

Users often confuse BSH and BASH and think both are the same while the latter is a progeny of the other. It’s true many BSH based shell scripts (.sh, .bash, .expect, etc) will run on Bash, too, because BASH includes a lot from BSH, but the opposite isn’t true. It offers many practical improvements over sh for programming and interactive use.

Pros:
  • Command line editing
  • Job Control
  • Unlimited size command history
  • Shell Functions and Aliases
  • Unlimited size Indexed arrays
  • Integer arithmetic in any base from two to sixty-four

You can think of Sh as the predecessor of Bash. It doesn’t have that many features, but it’s more standardized than Bash.

There are other special purpose variations of Bash which is inbuilt in most OS which have bash inbuilt. They are discussed in the post linked below.

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

bash shell- inbuilt variations

3. Dash (alias Debian Almquist SHell)

Dash is essentially Bash on Debian systems. If you are running a Debian-based distro, chances are you are running Dash, not Bash. The complexities of inheriting Dash as the default shell, as is done in most debian based distros, made the developers of Ubuntu (also a Debian based distro) decide to fork and use Bash as the default shell for interactive scripts instead of Dash as the default shell.

Cons
  • Dash lacks many of the features of Bash
  • Unable to perform tab completion and command history
Pros
  • 60% faster than bash
  • Severely smaller in size (100K vs. 900K)
  • Lowest resource requirement
  • Perfect for running on a not-so-powerful computer or low profile highly customized machines.

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

debian shell install dash shell

4. Pdksh Shell (alias Public Domain Korn SHell) and Ksh Shell (alias Korn SHell)

Ksh stands for Korn shell and was designed and developed by David G. Korn. It was introduced at about the same time as Tcsh, but unlike Tcsh, it’s compatible with Sh and Bash. It was an AT&T proprietary shell until 2000, and this is why it didn’t become that popular. The KShell was patched and rebranded as Public Domain Korn Shell or pdksh after it was pivoted to the open-source community.

It is a complete, powerful, high-level programming language and also an interactive command language just like many other Linux GNU/ Unix shells.

Ksh added more features to Sh which was later inherited into more modern shells. Prominent among them are listed below.

Pros:
  • Floating-point arithmetic
  • Job control
  • Command aliasing
  • Command completion.

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

unix shells install k shell


5. Fish (alias Friendly Interactive SHell)

The hunt and development / Frankenstein-ation of modern shells never ended with the Z-shell. The dawn of the 21st century saw the popping up of newer and more intriguing shells, such as the Fish Shell (or Friendly Interactive Shell). The FISH terminal was released mid-2005 and was not based on the Sh shell. Its most distinguishing aspect is that it has a unique command-line syntax that is designed to be more beginner-friendly. 

Unlike other shells, Fish has some pretty aesthetic oriented good features to encourage shell interaction for the more casual shell users.

Pros:
  • Manpage completions
  • Completion and selection with the arrow keys
  • Web-based configuration
  • Auto-suggestions
  • Fully scriptable with clean scripts
  • X clipboard Aggregation
  • Support for term256 terminal technology (256 terminal colors)

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

unix shells - install fish


6. Tcsh (alias Tenex C SHell) and Csh (alias C SHell)

The C and C++ programming languages were quite popular during the initial Linux days, and large portions of Linux itself is written in them. And to no surprise to no one a new shell popped up – the C Shell or Csh – that uses the vanilla C syntax model. If you are fluent in C, this shell will be natural to you.

However, the Csh shell had quite a lot of bugs and not many features. This is why the Tcsh shell came to the scene. Tcsh fixed most of the bugs and added new features. Unfortunately, Tcsh and Bash are very different, which means you can’t run Bash scripts in Tcsh and vice versa.

Tcsh is an enhanced C shell, it can be used as an interactive login shell and shell script command processor.

Pros:
  • C like syntax
  • Command completion
  • Job control
  • Command-line editor
  • Programmable word and filename completion
  • Spelling correction
  • Job control

More info can be found in the man pages or the wiki.

If you would like a more hands-on experience with the shell, click the image below.

unix shells - Install csh


Conclusion

These are not the only Linux GNU/ Unix shells available in but they are the top most used apart from those that are already installed on different Linux distributions and that have been tested and researched. Having said all this I would like to state that I personally use the zsh on my mac and bash on my ubuntu and redhat instances. That was my personal take on the matter. However, you should use the one best suited for you after giving each a chance of around 2-3 months at a time.

But once you do find your flavor of shell you will see significant improvement in work efficiency, focus and stamina. TRUST ME!

Hope you find this article useful and more any additional information, do not hesitate to post a comment.

Leave a Reply

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