For Legend look here

The Shell

The main program a user interacts with after login is the SHELL.
This is a program that interprets the user command and initiates the desired

The basic commands to know in unix are:

The shell program is a computer program that allows the user to enter a command
to the computer, that this then should execute.

There are several different programs that provide this functionality:

  • sh: Shell

    Basic shell program installed on any linux distribution

  • bash: Bourne Again Shell

    Shell program with some additional features.
    Configuration in

  • zsh: ZSH

    Advanced shell program, extensible and a lot features.
    Configuration in

  • fish: Friendly Interactive Shell

    A modern user friendly, but in some aspects not compatible to normal shell of
    Configuration in



Commands have a name without whitespaces and can have options or parameter
to alter their behaviour.

Parameters or Options of commands are seperated by spaces.
That means, if a parameter or option needs to include a space character, there
are two options:

  1. Escape Space: \␣
  2. Wrap in quotation marks: "␣"

Other special characters:

  • is used to encapsulate names/strings with spaces, and will also part of
    $Variable expansion, if needs to be used as such: \"

  • same as ", but without variable expansion. Escape: \'

  • > and < used in shells to redirect a stream to somewhere else.

  • (Pipe Symbol) used to send output of one command to another


Input and Output of Shell

Unix shells have three builtin character streams:

  1. Output Stream STDOUT has number 1
  2. Error Output STDERR has number 2
  3. Input Stream STDIN has number 0
Working with input and output
  1. Repeat something from input to output:

    echo Text that will be repeated by shell
    # Text that will be repeated by shell
  2. Redirect STDOUT to File:

    echo Text that will go to STDOUT goes to file > file
  3. Redirect STDERR to STDOUT:

    some_command 2>1
    # Can be combined with other redirects:
    some_command 2>1 1> file
  4. Hand output of one command to another command to process further:

    some_command | another_command


The Basic Commands