What is kernel, shell, shell script

Kernel
The linux kernel is the most important part or in order word called the heart of the linux operating system. It is the piece of code that manages both hardware and software components and communicates between them. It manages memory, processors, I/O devices with any applications and decides which applications will use hardware resources.

Shell
On your windows machine you have seen command prompt (command.com or cmd.exe) where you type command like ping, ipconfig etc. Similarly, on linux there is such prompt where you can type command and that prompt is called shell. In order to define shell we can say shell is an interpreter that interprets commands as typed from a keyboard or from a text script.

The shell is provided in order to interact with the computer systems. Shell itself is not part of the kernel, but it uses kernel to executes commands.

There are various types of shell and can be broadly defined into four categories.

1)Bourne like shell(sh): Almquist shell (ash), Bourne-Again shell (bash), Debian Almquist shell (dash), Korn shell (ksh), Z shell (zsh) falls into bourne like shell category.

2)C shell like (csh): TENEX C shell (tcsh) falls within this category.

3)Non traditional shell: es shell (es), scheme Shell (scsh) falls within this category.

4)Historical shell: Thompson shell (sh), PWB shell or Mashey shell (sh) falls within this category.

In order to know all available shells in your system issue, cat /etc/shells
On my system,
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh

To find out current shell you are using issue, echo $SHELL or ps $$
On my system,

# ps $$
PID TTY STAT TIME COMMAND
4593 pts/0 Ss 0:00 -bash
# echo $SHELL
/bin/bash

Shell Script
Shell script is a plain text file which contains a series of commands. In this case instead of running command one by one we can store all commands in a script and we execute the script. It is similar to a batch file in MS-DOS.

Comments

Popular posts from this blog

ORA-00923: FROM keyword not found where expected

How to make partitioning in Oracle more Quickly

Copy files between Unix and Windows with rcp