From ArchWiki
Revision as of 05:16, 13 February 2012 by Skydiver (Talk | contribs) (add i18n template, update templates, see Help:Style)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Korn Shell (ksh) is a standard/restricted command and programming language developed by AT&T.


The version from AT&T can be found on AUR

The MirBSD™ Korn Shell is another free implementation of the Korn Shell. It can be found on AUR.

The Public Domain Korn Shell is in the extra repository. Install with pacman:

# pacman -S pdksh

Making Ksh your default login shell

Arch Linux init scripts use Bash. After the boot process is complete, the default login shell is user-specified. The chsh command can be used to change a user's default login shell without root access if the shell is listed in /etc/shells. (If Ksh was installed using pacman, it should already have an entry in /etc/shells).

Grab the full path for Ksh using /usr/bin/which:

$ which ksh

Which will probably output:


Change the default shell for the current user:

$ chsh -s /bin/ksh

Alternative as root, using usermod

Change the default shell using usermod:

# usermod -s /bin/ksh username
Note: The user needs to logout and log back in, to start using Ksh as their default shell.

After logging back in, verify that Ksh is the default shell with:

$ echo $SHELL


You must first change your default shell back to Bash before removing the Ksh package.

Change the default shell for the current user to bash:

$ chsh -s /bin/bash

Alternative as root, using usermod

Change the default shell using usermod:

# usermod -s /bin/bash username

Now you can safely remove the Ksh package:

# pacman -R pdksh
Warning: Failure to follow the above will result in all kinds of problems.

If you did not follow the above, you can still change the default shell back to Bash by editing /etc/passwd as root.

For example:


username:x:1000:1000:Full Name,,,:/home/username:/bin/ksh


username:x:1000:1000:Full Name,,,:/home/username:/bin/bash

External Resources

pdksh official page

Korn Shell at Wikipedia

pdksh man page at die.net

Home Page For The KornShell Command And Programming Language

pdksh man page at OpenBSD