You are on page 1of 2

12/27/2017 A Quick Introduction to Unix/Components ­ Wikibooks, open books for an open world

A Quick Introduction to
Unix/Components
Unix is made up of three components

1. the kernel;
2. the shell; and
3. programs.

Contents
The kernel
The shell
Which shell?
Programs
Contents

The kernel
The kernel of Unix is the heart of the operating system. It allocates time and memory to programs and handles the file
structure and communication between the different parts of the computer system such as the keyboard and the screen.

The shell
The shell is an interface between the user and the Unix kernel. It resembles the ‘dos box’ that Windows displays if you
run the command cmd. When a user logs in, Unix checks their username and password and then starts a program
called the shell. The shell interprets the commands the user types and transmits them to the kernel to be executed.
These commands are programs.

There are a variety of shells available for the various Unix systems. The expert user can customise their own shell and
users can use different shells on the same machine.

The shell and kernel work together like this:

a user types cat somefile to display a file;
the shell finds the program cat;
the shell instructs the kernel to run the program cat on somefile;
When the program finishes the kernel passes control back to the shell and displays the Unix prompt.

Which shell?
There are a number of different shells for Unix. People can become very attached to the shell they prefer. Popular shells
include

sh (http://en.wikipedia.org/wiki/Bourne_shell) ­ the bourne shell
bash (http://en.wikipedia.org/wiki/Bash_(Unix_shell)) ­ the bourne again shell
csh (http://en.wikipedia.org/wiki/C_shell) ­ the c shell

https://en.wikibooks.org/wiki/A_Quick_Introduction_to_Unix/Components 1/3
12/27/2017 A Quick Introduction to Unix/Components ­ Wikibooks, open books for an open world

ksh (http://en.wikipedia.org/wiki/Korn_shell) ­ the Korn shell (strangely, not named for the band)
zsh (http://en.wikipedia.org/wiki/Z_shell) ­ the z shell
You can invoke any shell installed on your system with one of the above commands at the prompt. (Notice that this
means you start a new shell within a shell!). We won't cover the distinctions about different shells at this time. When
you begin to write Unix Shell Scripts you will probably want to choose a shell and stick with it if you can. Each shell
has its advocates. The Bourne again shell  is  popular  with  many  script  writers.  Some  in  the  Unix  community  have
expressed  doubts  about  the  suitability  of  the  c  shell  for  scripting,  but  this  is  something  you  can  address  when  you
know more about Unix (see Csh Programming Considered Harmful (http://www.faqs.org/faqs/unix­faq/shell/csh­wh
ynot/)).

You can start a shell of a particular kind by typing the shell name at the command line prompt.

Programs
Programs  are  not  part  of  the  operating  system  as  such,  but  they  are  logical  sequences  of  commands,  developed  for
implementing specific tasks. They usually include application software running at the user end.

Contents
Components
Shells and subshells
Directory Structure
Changing Directories
Listing Files and Directories
Pathnames
Files and Processes
Wildcards
Exercises 1
Creating Directories
Creating Files
Special Directories
Exercises 2
Copying Files
Moving Files
Deleting Files
Exercises 3
Redirection
Searching Text Files
More grep examples
Permissions on Files and Directories
Editing Text
Exercises 4
My First Shell Script
Job Control
Links
Environment Variables

Retrieved from "https://en.wikibooks.org/w/index.php?title=A_Quick_Introduction_to_Unix/Components&oldid=3248592"

This page was last edited on 30 July 2017, at 23:53.

Text is available under the Creative Commons Attribution­ShareAlike License.; additional terms may apply. By using
this site, you agree to the Terms of Use and Privacy Policy.

https://en.wikibooks.org/wiki/A_Quick_Introduction_to_Unix/Components 2/3

You might also like