Linux / UNIX: Change Bash To KSH Shell

You can change the default shell in Linux or UNIX to KSH (KornShell) using the following steps:

  1. Check if KSH is installed on your system:
which ksh

If KSH is not installed, you can install it using the package manager for your operating system (e.g., apt-get on Ubuntu, yum on Fedora, etc.).

  1. Verify that you have permission to change your shell:
chsh -s $(which ksh)

If you receive an error indicating that you do not have permission to change your shell, you may need to run the above command as the root user (i.e., sudo chsh -s $(which ksh)).

  1. Log out and log back in to activate the change.
  2. Verify that KSH is now your default shell:
echo $SHELL

This should return the path to the KSH executable, indicating that it is now your default shell.

Leave a Comment