Kernel and Shell
The kernel is the core program of an operating system. It is designed to control all computer resources. A shell is a CLI (Command-Line Interpreter) used as a bridge between the kernel and the user of the operating system. Basically, when you manage Linux OS (the kernel), you run commands through a CLI called a shell.
Types of shells
There are different types of shells. The most basic one is sh but its functionality is limited. The most widely used shell is bash. There are other shells such as zsh, ksh, and csh. Basic functionalities are the same across different shells but there are additional functionalities provided by each shell. In this course, we are using bash.
Command-Line
When you open a command line, you usually see typically three types of information followed by a cursor.
- Name of the machine (differs by machine)
- Current Working Directory location (the concept of the current location on a computer will be explained in the next section)
- Prompt symbol (typically,
$
or%
)
A prompt symbol represents a shell and waits for user input.
The symbol can be different depending on 1) the login user type, and 2) the type of shell.
If you log in to the system as a normal user, there are two symbol options based on the type of shell:
$
: sh, bash, ksh%
: csh, zsh
When you are logged in as a superuser, the symbol is #
. (To learn more about the superuser, check Superuser (Root User) vs. Normal User.
Note
You can check your current shell by running the echo command.
echo $SHELL
When you run the command, you may see a result like the one below. In this case, bash is the current shell. Usually, the shell is under the /bin directory.
/bin/bash