IT 1100 : Introduction to Operating Systems

Chapter 2


The Shell Prompt

The prompt on each Linux machine may look different. But on scratch it will use this format:

username@machinename:~$

When I am connected to scratch it will look like this:

smorgan@scratch:~$

The @ symbol is just what it looks like - an at symbol.

The : is just a separator. It acts like a space without being a space. We will use colons as separators throughout the semester.

The ~ (tilda) means that you are currently in your own home directory. If you are in a different directory it will display that for you here. Aka - the Current Working Directory.

Standard Users have limited permissions it is best to be logged in as a standard user as often as possible. The dollar sign $ at the end of the prompt signifies that we are in Standard User mode.

Super Users have all permissions at all times, ie Administrative privileges. If there is a hash # at the end of the prompt it signifies that we are in Super User or Root mode. Avoid Super User mode if at all possible.

Remember - Super Users have all power, all the time, to do all damage.


The home directory

In Linux there are two different meanings to the words home directory. It is essential to know the difference.

The user home directory is denoted in several ways. All of the following mean the same thing.

$HOME is where you want to be.


File and Directory Paths

When we declare a path to a file or directory we do so using forward slashes. Everytime we want to enter a new directory we add another slash.

If we were to look at my home directory /home/s/smorgan/, using the GUI and a mouse -

Pretend that I have a directory inside of my $HOME directory called fruit. To access this the first thing we need to do is declare the path to my $HOME directory.

/home/s/smorgan/

Fruit is also a directory so I simply add it to the end.

/home/s/smorgan/fruit/

If I want to access a file in the fruit directory called salad.txt I simply add that to the end.

home/s/smorgan/fruit/salad.txt

When accessing directories the final slash is optional. Files will never end in a slash.


Absolute vs Relative Path

This is a very important concept. Knowing the path to get from where you are to where you want to be gives you tremendous power.

We will be studying this all semester long.

Absolute Path is the path from the root ( / ) of the directory system to where you want to go.

Absolute path always begins with a slash.

Relative Path is the path from where you are to where you want to go.

Relative path always begins without a slash.

Linux also has special notations it uses that make it easier for us to declare relative paths.


More Examples - Are these Absolute or Relative Paths? Remember the final slash is optional for directories and files will never end in a slash.


Textbook Time

Open a terminal connection to scratch and then Read and Complete the Excercises in the Book


Last Updated 12/15/2017