Unix Shells

A Unix shell, in the sense I will use here, is a command-line interpreter that provides an interface for the user to operate Unix or Unix-like systems. Over the years, several shells have been developed with different characteristics. Here I will briefly comment on the most well-known shells and provide tips for configuring the shell I use.

In the following diagram, the six most popular shells are organized in a way that a shell from a lower level extends the functions of the shell above. Shells from different branches are incompatible.

csh (C shell)      sh (Bourne shell)
      |               /         \
      |               |     ksh (Korn shell)
      |               |          |
tcsh (TC shell)      bash    zsh (Z shell)
  1. C shell (csh)

    Created by Bill Joy while a student at UC Berkeley, it was released in 1978 as part of BSD. It was popular for scripting as its syntax resembles the C language, but it is criticized for defects in its implementation.

  2. TC shell (tcsh)

    Tcsh is essentially the C Shell with some extra features, such as tab completion, command-line editor, and better history manipulation.

  3. Bourne Shell (sh)

    It is the traditional shell developed by Stephen Bourne at Bell Labs and released in 1977. It was the default shell for Unix7, and newer versions are still widely used today.

  4. Bourne-again Shell (Bash)

    Written by Brian Fox for the GNU project, it was released in 1989 to replace the Bourne Shell and add various functionalities. It is widely used as the default shell in many Linux distributions and Mac OS X.

  5. Korn shell (ksh)

    It was developed by David Korn at AT&T Bell Labs and released in 1983. It is very popular for being fully compatible with the Bourne Shell and having several other features, some copied from the C Shell.

  6. Z shell (zsh)

    It was written in 1990 by then student Paul Falstad, from Princeton University, and is the most complete shell in this list. It can be considered an extension of the Bourne Shell with various enhancements based on bash, ksh, tcsh, and also has its own features, including a spell checker.

Since Zsh is my favorite shell, I will write more about its installation and configuration (on Arch Linux).

  1. In /etc/shells, check the list of installed shells. If zsh does not appear in this list, install it.

    $ sudo pacman -S zsh
  2. Test the installation and configure the basic options

    $ zsh
  3. Make Zsh your default shell (applied after a new login).

    $ chsh -s $(which zsh)
  4. Edit the main configuration file, ~/.zshrc.

    An easy way to edit the file is through Oh My ZShell:

    git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
    cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
    chsh -s /bin/zsh

    I keep a copy of my configurations at https://github.com/jbsilva/dotfiles.

Julio Batista Silva
Julio Batista Silva
Data Engineer

I’m a computer engineer passionate about science, technology, photography, and languages. Currently working as a Data Engineer in Germany.

comments powered by Disqus