Install KornShell in Ubuntu 22.04

In this article, we would discuss how to install KornShell in Ubuntu 22.04 release. The KornShell was developed by David Korn. It was first released in the year 1983.

When we start a terminal, the first program which starts with it is shell. It can also be used as a command-line interface (CLI).

If we want to know the default login shell, then look for relevant entry in passwd file. Just open a terminal and issue the following –

cat /etc/passwd | grep $USER

Generally, if you haven’t made any changes to your default shell then, you would find Bourne Again Shell entry there.

/bin/bash

Overall, Bourne Again Shell is the default shell in Ubuntu. But, we can install other shells as well.

Note: Following operations would require you to have superuser privileges. In case you don’t have one then, we advise you to contact your System Administrator for assistance.

Install KornShell in Ubuntu 22.04

Since, the package is available through standard Ubuntu repository. Therefore, we need to update the repository first. This ensures we get to have the latest version of the package available. Hence, open a terminal and issue the following –

sudo apt update

Next, to install KornShell –

sudo apt install ksh93u+m

Now, to launch KornShell –

ksh

If we want to exit KornShell –

exit

In conclusion, we have discussed how to install KornShell in Ubuntu 22.04 release.

Additional Info –

Apart from normal KornShell, we can also work with its restricted version. We don’t have to install anything other than what we have already installed. There are two methods of invoking Restricted KornShell –

rksh

or,

ksh -r

Few of our actions restricted with Restricted KornShell are –

  1. We can’t change our present working directory and,
  2. No changes to variables like SHELL, PATH, ENV allowed.

Note: Only couple of restricted actions we have discussed here. More of those would be covered in subsequent articles in detail.

Similar Posts