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)
-
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.
-
Tcsh is essentially the C Shell with some extra features, such as tab completion, command-line editor, and better history manipulation.
-
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.
-
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.
-
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.
-
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).
-
In
/etc/shells
, check the list of installed shells. If zsh does not appear in this list, install it.$ sudo pacman -S zsh
-
Test the installation and configure the basic options
$ zsh
-
Make Zsh your default shell (applied after a new login).
$ chsh -s $(which zsh)
-
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.
Links
- Comments: http://linuxfinances.info/info/unixshells.html
- Comparative table: http://www.faqs.org/faqs/unix-faq/shell/shell-differences/
- Arch Wiki - Zsh: https://wiki.archlinux.org/index.php/Zsh
- Customization of various Shells: http://www.understudy.net/custom.html
- Differences: http://www.softlab.ntua.gr/facilities/documentation/unix/shelldiff.html
- Comments on Shell and scripts: http://faculty.plattsburgh.edu/jan.plaza/computing/help/shells.html
- Zsh - Official FAQ: http://zsh.sourceforge.net/FAQ/zshfaq01.html
- Zsh Lovers - http://grml.org/zsh/zsh-lovers.html
- Oh My Zshell (framework) - https://github.com/robbyrussell/oh-my-zsh
- ZSH Wiki: http://zshwiki.org