A Unix shell is a program that interprets the commands or scripts and acts as an intermediary between user and kernel of the system.
Like bash, zsh, ksh, fish and many other shells csh is also a Unix shell. It was developed by Bill Joy. Its syntax is based on the c programming language.
It was originally developed for BSD OS. The tcsh shell is an improved version of csh(c shell). Ahead in this article, we will discuss the installation and usage of c shell in Ubuntu, Linux mint, or a distribution based on them.
How to Install csh (C Shell) in Ubuntu?
On Ubuntu, c shell is currently available in the universe repository. In order to install it in your system, you need to enable this repository.
Now to install the csh in your system use the following command –
sudo apt-get install csh
Press y if ask for confirmation –
Now the installation is complete and your system has multiple shells installed.
How to Use csh?
Bash is the default shell for many Linux distributions. To access the csh from a bash prompt, run the following command in your terminal –
csh
By default, csh uses a % (percent) symbol for its prompt. To exit from the c shell use the following command –
exit
Make csh as your default shell
Before you make csh as your default shell, first you need to find the location where it is installed. Use the following command to find its location –
whereis csh
Now you can see /bin/csh
is its location.
To make it you default shell use the following command –
chsh -s /bin/csh
The root user can make csh default for a specific user with –
chsh -s /bin/csh user_name
Now replace the user_name with the actual user in your system. If you want to make bash again as your default shell then use the following command in your terminal –
chsh -s /bin/bash
Conclusion
The main objectives of designing csh were that it should look more like the c programming language and it should be more interactive. An improved version of csh called tcsh is available for Linux or Unix systems. We will discuss it in some other article. If you have a query or suggestion related to this topic then you can write to us in the comments below.