Korn Shell is an upward-compatible extension to the original Unix shell, written by David Korn and released as part of System V. The Korn shell is now the default shell on many Unix systems, particularly those based on System V, including UnixWare and many others.
Because the Korn shell is an extension of the Bourne shell, everything that works in the Bourne shell also works in the Korn shell.
The Korn shell also adds the following:
- Interactive editing of the command line with either vi or emacs;
- Better function definitions providing local variables and the ability to create recursive functions;
- Extensive pattern matching for filenames, similar to regular expressions.
Several features were adapted from the C shell, including:
- Command history allowing retrieval and reuse of previous commands;
- Job control and the mechanism for moving jobs between the background and the foreground;
- Aliases for abbreviated command names;
- The tilde (~) used as a shorthand for the name of the home directory.
Checking Korn shell version
The original Korn shell version is known as ksh88. It defaults on many UNIX like operating systems. The ksh93 is an updated version. There are also modified versions of ksh93 which add new features. To get ksh version open a command-line terminal (select Applications > Accessories > Terminal), and then type the following command: