October 3rd, 2019

Operating systems

Operating system

Set of programs which make the computer work.

The UNIX operating system is made up of three parts:

  • the kernel
  • the shell
  • the programs

Parts of UNIX

The kernel

The kernel of UNIX is the hub of the operating system:

  • it manages time and memory for programs
  • handles the disk and secondary storage
  • handles communications and networking

The kernel wraps the different hardware. No other software can interact with the hardware.

Programs have to ask to the kernel to access the hardware

The shell

Interface between the user and the kernel

When a user logs in

  • the system checks the username and password
  • then starts another program called the shell
    • a command line interpreter (CLI).
  • it shows a prompt $
  • It interprets the commands the user types and executes them
  • The commands are programs
  • When they finish, the shell gives the user another prompt $

The Directory Structure

All the files are grouped together in the directory structure

  • The file-system is arranged in a hierarchical structure
    • like an inverted tree
  • The top of the hierarchy is called root
    • written as /

The Directory Structure

In the diagram above, we see that the home directory of the user ee51vn contains two sub-directories (docs and pics) and a file called report.doc

The full path to the file report.doc is /home/its/ug1/ee51vn/report.doc

Listing files and directories

ls (list)

When you first login, your current working directory is your home directory

To find out what is in your home directory, type

$ ls

The ls command ( lowercase L and lowercase S ) lists the contents of your current working directory.

ls command

There may be no files visible

In that case, the UNIX prompt will be returned

ls does not show all the files but only those ones whose name does not begin with a dot .

Files beginning with a dot . are known as hidden files and usually contain important program configuration information.

They are hidden because you should not change them unless you are very familiar with UNIX!!!

Listing hidden files

To list all files in your home directory including those whose names begin with a dot, type

$ ls -a

Commands can have options

ls is an example of a command which can take options: -a is an example of an option.

The options change the behaviour of the command.

There are online manual pages that tell you which options a particular command can take, and how each option modifies the behaviour of the command

How to know the options?

In the old times, people looked it in the “Manual”

Later people realized that you can have the manual in digital form, inside the computer

To see the manual page of ls, use the command man ls

The shell

Interface between the user and the kernel

When a user logs in

  • the system checks the username and password
  • then starts another program called the shell
    • a command line interpreter (CLI).
  • it shows a prompt $
  • It interprets the commands the user types and executes them
  • The commands are programs
  • When they finish, the shell gives the user another prompt $

Original material