How To Install Korn Shell in Ubuntu?
 

How To Install Korn Shell in Ubuntu?

 

This post was last updated on August 1st, 2020 at 03:44 pm

A Unix shell is a program that interprets the command or script and acts as an intermediary between user and kernel of the system. Bash, zsh, csh, and fish are some examples of Unix shells. Bash is a default shell for most of the Linux distributions.

Like other shells ksh (Korn Shell) is also a Unix shell available for almost all Linux or Unix users. It was developed by David Korn in Bell Labs in the early 1980s.

Ahead in this article, we will see about the installation and use of ksh in Ubuntu and its aligned distributions.

Korn Shell vs Bash

The major difference between ksh and bash are –

  • Korn shell has associative arrays and bash doesn’t also it has built-in floating-point operations.
  • Bash handles getting exit codes from pipes in a cleaner way.
  • Korn shell has the print command which is way better than the echo command.
  • Korn shell has the r history command that allows quickly to re-run older commands.
  • Bash is much easier to set a prompt that displays the current directory.
  • Korn shell has three command-line editing styles based on vi, emac, and gosling emac.

How to install the Korn shell?

To install Korn shell in Debian/Ubuntu and their derivative, First, open the terminal by pressing ctrl+alt+t. And then use the following command –

sudo apt-get ksh

Press y if it asks for confirmation –

Now ksh installation is complete. Your system has multiple shells installed. If you want to make ksh as your default shell then find the path where it is installed.

Locating ksh

To find the location where ksh is installed execute the following command in your terminal –

whereis ksh

Now you can see in the above image /usr/bin/ksh is the location of ksh.

Using ksh

For using ksh temporarily, you can access it from bash by using the following command –

ksh

Korn shell also uses a $(dollar) symbol as the default prompt.

if you want to exit from the ksh use the following command –

exit

Make Ksh as your default shell

To make ksh as your default shell execute the following command in your terminal-

chsh -s /usr/bin/ksh

The root user can make it default for a particular user by using the following command –

chsh -s /usr/bin/ksh user_name

Now if you want to make bash as your default shell again then run the following command in your terminal-

chsh -s /bin/bash

Conclusion

In this article, you learn about Korn shell, its installation, and making it your default shell. I hope this is useful to you. If you have a query or suggestion regarding the topic you can write to us in the comments below.

Previous How To Install And Use C Shell In Ubuntu?
Next How To Set/Change Root Password In Ubuntu?
 

About author

You might also like

Linux Terminal 0 Comments

What Is A Virtual Terminal In Linux/Unix?

This post was last updated on August 1st, 2020 at 02:24 pmA virtual terminal or virtual console is a feature of Unix based system that allows multiple users to access

Linux Terminal 0 Comments

How to Compile and Run C Program on a Linux Terminal

This post was last updated on April 17th, 2021 at 11:08 pmLinux is the best platform to learn C programming because it is an open source platform and you will

Linux Terminal 0 Comments

How To Manage KVM Virtual Machines From The Host Terminal?

This post was last updated on August 1st, 2020 at 12:24 pmVirtualization means creating virtual instances of resources such as storage devices, network resources, etc. Kernel-based virtual machine or KVM

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply