From Linux Bash Shell Scripting Tutorial Wiki
Jump to navigation Jump to search

Ksh is an acronym for KornSHell. It is a shell and programming language that executes commands read from a terminal or a file. It was developed by David Korn at AT&T Bell Laboratories in the early 1980s. It is backwards-compatible with the Bourne shell and includes many features of the C shell.

Different Ksh version

  • Ksh has major implementations (versions):
    • ksh - The real, AT&T version of the Korn shell.
    • pdksh - A public domain version of the Korn shell
    • mksh - enhanced version of the Korn shell
    • ksh88 - An updated ksh version, mostly ship by some UNIX vendor such as Sun Solairs and installed as /bin/ksh. Hoever, most vendors now ship ksh93.
    • ksh93 - An updated ksh version with many improvements such as arrays, floating point arithmetic, etc.

Install ksh

Under Debian, or Ubuntu Linux, use apt-get command as follows to install ksh:

sudo apt-get update
sudo apt-get install ksh pdksh

Under Red Hat, CentOS, or Fedora Linux, use yum command as follows to install ksh:

yum install ksh

How do I use ksh?

Simply type ksh at a shell prompt to use ksh shell:




How do I set ksh as a default login shell[1]?

Use chsh command to change your login shell:

chsh  -s /bin/ksh
chsh  -s /bin/ksh username


External links