operating-system-basics-linux-2021
operating-system-basics-linux-2021
The Linux operating system is based on the much older Unix operating system, first
developed in 1969 at Bell Labs in New Jersey.
This document introduces you to the basics such as accessing free applications,
managing your files and using the terminal. There are many Linux distributions, and
this guide does not cover all case. The examples will usually be from Ubuntu.
Contents
• Useful Applications (e.g. Free access to Office365) Page 2
• Managing Applications (e.g. Split Screen and Virtual Desktops) Page 5
• Managing your Files (e.g. Organising files/folders and backups) Page 7
• Using a Terminal (e.g. Text-based commands to create folders) Page 13
1
Useful Applications
Your operating system will come bundled with some applications. Departmental
computers will already have all the software you need, however if you are working on
a personal computer there may be some software you need to install.
Office 365
Students and staff at the University can access Office 365, which contains many
useful applications for University work. The University of Oxford Office 365 system
includes a cloud based working environment (called Nexus365). Follow the
instructions here to get started: https://help.it.ox.ac.uk/nexus365/getting-started
One Drive: A cloud based filing system. You can use this to backup
your files and share files with other people.
Word: The Microsoft word processor. You can save files as a Word
document(.docx) to One Drive or your own computer.
One Note: A digital notebook, you can use this for taking notes.
Each of these can be used online, in your browser. This is the most reliable option as
there is no official installation from Microsoft for Linux systems. Some browsers work
better than others, so having multiple installed (e.g. Chrome & Firefox) can be useful.
2
You can only get full functionality by installing the software directly onto your
machine. There are options for getting a full installation working on Linux using
Virtual Machines. See for example the instructions on makeuseof.com.
Sometimes it capitalizes the first letter of the SSO, if so change it back to lower case.
PDF Reader
You will need to use PDFs. Whichever PDF Reader you use, make sure you can:
• Make notes and highlight
• Search within PDFs: You will often work with many documents, searching for
key terms using the Search bar is much faster than scrolling.
• Viewing Headings for Navigation: You can save a lot of time by enabling
the navigation pane to click through Headings, shown here circled in yellow:
3
Creating Text Files
You will not always want files where the text is formatted. In some cases
you will want something very simple: just words as a .txt file. This could because of:
• personal preference (some people prefer the minimalist environment)
• the wider range of compatibility (all OS will be able to read a .txt even if Word
is not installed).
Most Linux distributions should have a Text Editor installed. For some distributions,
you can create a New Document by right clicking on the background in the File
Browser. Then double click on the Document and it will open in a Text Editor.
• Rich Text format contains extra formatting codes for changing the font and
size of the text and other formatting commands. These save to .rtf files.
Security
Keeping your computer, files and identity safe is hugely important. Sophos Anti-Virus
is available for free from the Central IT pages, using the above link. You should also
consider creating strong passwords and using a password manager. Much can be
found online, for example from Reporters without Borders.
4
Managing Applications
Often you will need to work with multiple applications (apps) open. For example, if
you are coding you may need a PDF of instructions open as well as MATLAB. Or if
you are writing a report you may need an internet browser and a Word document.
This section introduces you to different ways to work with multiple apps.
To get the best from your computer, it is important to only have the applications open
that you need for your current task. Having too many applications open at once will
cause your machine to be slow. You might think you are quitting applications by
minimising and closing:
• Minimise an app by pressing the - button in the top-right corner of the window
• Close windows of an app by pressing the X button in the top-right corner
However, minimising and even closing windows does not always quit the app.
The app can still be using memory, which will slow down your computer.
Quit rather than close/minimise any applications you are not using.
This will free up RAM (a type of computer memory).
To check which applications are using memory, use the Systems Monitor.
Under the Processes tab you will see a list of all programs running. To stop an
unresponsive program , simply select it and right-click. You can then select:
• Kill which forces the app to quit, only use if End Process does not work.
For more information, see this article on how Linux uses memory.
5
Split Screen View
To work with two applications at once, a simple option is to split the screen between
two applications. To do this:
• Open two applications on a Desktop.
• Move your cursor to the edge of a window, and when an arrow appears resize
the window by holding and dragging.
You can drag the divide between the two applications to the left and right.
Maximising Applications
The approach of splitting the screen is not always the best option – particularly if you
have a small monitor. Sometimes we need to work with an application which has
been maximised to fill the screen. Maximise an application by pressing the square in
the top-right corner of an app window.
6
Managing your Files
A file is just a lot of ones and zeros stored in a permanent location on the
computer. Each file is used to store a particular type of object.
There are thousands of files on a typical computer. A file system is used to keep
track of all the files. The file system is divided into folders.
A folder, also known as a directory, is a location where all the files related to
a particular topic are stored. Folders help keep related files together, so they
do not get mixed up with other files on the system.
Files and folders may seem basic, but keeping them organised can be a difficult
habit to develop. It is always worth taking a few moments to correctly store your files.
7
A File System
The whole file system is organised in a hierarchy of folders within folders. The
diagram on the right represents a very small portion of a Linux file system. Another
name for a folder is a directory.
/ Root Directory
Director
At the top of the file system is the folder known
as the root directory. It is specified with a
etc home usr
forward slash “/”. The root directory contains
many other directories than shown here.
Jack's Home Directory Jack
directories.
P5comp P5mech
In the diagram:
MyFrame.mat
• The parent of Sess1 is P5comp. ReadMe.txt Sess1 Sess2
Home Directory
When using a computer, you don't want to mix up your files with those used by the
operating system and other users. Therefore, each user on a system is allocated a
Home Directory, where they can store their personal files. On most Linux systems,
these are all kept in the home folder. An example of creating folders is given on
the next page. Follow these to create the structure shown in the diagram above.
For a more in-depth guide to the file system on Ubuntu, see this video.
8
Example: Creating Folders in your Home Folder
Some Linux systems have a choice of different GUI. There are also many ways of
configuring a GUI. You will need to use a File Browser. The following instructions
show to how build the example file structure on the previous page:
The idea is that as you do more work on your computer, you slowly build a hierarchy
structure of folders, so that you can easily find the files that you need. e.g. If you
create files for the mechanics laboratory, put them into a P5mech folder in Year1.
File Paths
The file path is a way to describe the location of a file or folder, based on a fixed
starting point. Every file/folder will have a unique absolute path.
The Absolute Path of a file/folder (e.g. fileA) is the path you would have to
take from the top of the system (root directory) to reach that file/folder.
The absolute path of a file can be very long. A quicker way to specify the path from
the Current Working Directory to the file or folder you are interested in. This is
called the relative path to a file. This describes a files location relative to the
Current Working Directory.
9
The Relative Path of a file/folder is the path you would have to take from
the current Working Directory to the original file/folder.
Sess2
• The Relative Path to prog1.m is etc home usr
../Sess1/prog1.m
Jack's Home Directory Jack
• The Relative Path to MyFrame.mat is
../../P5mech/ MyFrame.mat
Eng
Relative paths take some getting used to, but Year1 Year2
can be a powerful tool when managing many
files. P5comp P5mech
MyFrame.mat
ReadMe.txt Sess1 Sess2
prog1.m prog2.m
10
Backup using OneDrive
It is always a good idea to take a copy of your files, just in case anything happens to
your computer. As part of your University Single Sign On (SSO) account, you have
access to One Drive. This is a file storage area linked to the Microsoft Office Suite
available online.
Once you logged in, select OneDrive on your dashboard to open your file storage:
• Use the Upload button to add files or folders to your storage area. You can
also drag and drop. Try uploading a Folder.
• In OneDrive, Right Click any file and select Download to download a file.
11
Using Zip Folders
12
Using a Terminal
So far we have shown the the easiest way of interacting with the operating system:
using a Graphical User Interface or GUI. This is where you interact with the
computer using a mouse pointer and click to interact with applications.
The GUI that you use to interact with your computer is a part of the Shell. However,
this is not the only way of interacting with the Kernel. There are also text based
commands that allow you to control the OS without a mouse. This is known as using
the Command Line.
To use the command line, we use a Terminal environment.
It is a simple window where we can type text.
Imagine Errol the Engineer has just returned from a six-month survey of materials in
different off-shore structures. The 1430 samples have been run through a testing
machine, resulting in 1430 data files. The research group has worked with files from
this machine before, and know before they can graph the results the files need to be
put through a program called reformatData.sh. In the past, they only had 20 files, so
this script was run 20 times by hand. If Errol has to run reformatData.sh by hand
using a GUI, they will have to select and open a file 1430 times! If it takes even 30
seconds to run each file, the whole process will take more than 12 hours. With the
shell, Errol can instead assign the computer this mundane task!
It is important to know the shell exists and what it can do. The next few pages
give a brief introduction. For a full introduction to shell, see this online course.
13
Navigating Files using the Terminal
1. Launch Terminal
This can be found in Applications.
/ Root Directory
Director
In the terminal, enter the command :
P5comp P5mech
Notice that when you press Enter,
you will see a path returned. MyFrame.mat
ReadMe.txt Sess1 Sess2
In our example it would be:
/home/Jack
prog1.m prog2.m
14
3. List items in Current Folder
To list the content of the Current Working Directory enter
You should see a list of all the files and folders in your Home directory.
In our example, it would simply list one folder Eng.
cd Eng
pwd
ls
In our example, we would see the current path printed (due to the pwd command):
/home/Jack/Eng
Then a list of folders Year1 and Year2.
mkdir Year3
ls
You should then see the new folder listed after the list command.
ls /
ls /usr
ls /home
15
or the relative path of the folder:
ls Year1
ls Year1/P5computing
ls ~
ls ~/Downloads
Two full stops .. indicates the parent folder. The folder one level above :
ls ..
ls ../..
cd Year1/P5computing
pwd
cd ..
pwd
cd /usr
pwd
cd
pwd
Now make another new directory inside P5Computing using the command mkdir.
cd ~/Year1/P5computing
mkdir NewFolder
16