Linux 2023

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 46

University of Information Technology

Introduction to Linux Operating System

2023-2024 Academic Year


Handbook History

Date Version Author Remark


th
20 November, 2013 0.1 Lecturers, First Version
FCS
26th November, 2014 0.2 Lecturers, Second Version
FCS
30th November, 2015 0.3 Lecturers, Third Version
FCS
1st December, 2017 0.4 Lecturers, Fourth Version
FCS
20th November, 2018 0.5 Lecturers, Fifth Version
FCS
9th November, 2022 0.6 Lecturers, Sixth Version
FCS
Contents at a Glance

1. Introduction to Operating System ………………………………………………………... 5


2. Introduction to Linux …………………………………………………………………………………… 5
3. Introduction to Ubuntu and Installation …………………………………………………………….10
4. Understanding the Ubuntu Desktop ................................................................................................... 20
5. Hands on at Command-Line (Terminal) in Ubuntu ..................................................................... 30
6. Exercises ................................................................................................................................................... 42
Tables and Figures ...................................................................................................................................... 43
Appendix A - Ubuntu Linux System Directories .............................................................................. 44
Appendix B – Nautilus Keyboard Shortcuts ........................................................................................ 45

Introduction to Linux 2 of 45 Faculty of Computer Science


Table of Contents
1. Introduction to Operating System ........................................................................................................ 5
2. Introduction to Linux ............................................................................................................................... 5
2.1. Linux History.......................................................................................................................................... 5
2.2. Advantages of Linux ............................................................................................................................ 6
2.3. Software License ................................................................................................................................... 7
2.3.1. GNU General Public License ......................................................................................................... 7
2.3.2. Copyleft ................................................................................................................................................ 7
2.4. Linux Distribution ................................................................................................................................. 7
3. Introduction to Ubuntu and Installation ……………………………………………………………. 9
3.1. Why should choose Ubuntu ............................................................................................................. 10
3.2. Ubuntu Installation.............................................................................................................................. 10
3.2.1. Minimum System Requirements ................................................................................................. 10
3.2.2. Downloading Ubuntu ..................................................................................................................... 10
3.2.3. 32-bit versus 64-bit.......................................................................................................................... 10
3.2.4. Installation Methods........................................................................................................................ 10
3.3. Installation Steps.................................................................................................................................. 11
4. Understanding the Ubuntu Desktop .................................................................................................. 19
4.1. The Menu Bar ....................................................................................................................................... 19
4.2. Using the Activities Menu ................................................................................................................ 20
4.2.1. Search for files and applications in Activities ......................................................................... 20
4.3. The Dock................................................................................................................................................ 20
4.3.1. Using the Dock ................................................................................................................................. 21
4.3.2. Adding and removing applications from the Dock ................................................................ 21
4.3.3. Find applications .............................................................................................................................. 22
4.4. Applications .......................................................................................................................................... 22
4.4.1. Office Suites ...................................................................................................................................... 22
4.4.2. Working with documents, spreadsheets, and presentation .................................................. 23
4.4.3. Working with documents .............................................................................................................. 23
4.4.4. Working with spreadsheets ........................................................................................................... 23
4.4.5. Working with presentations. ......................................................................................................... 23
4.4.6. Network Manager ............................................................................................................................ 23
4.4.7. CD/DVD Burning ............................................................................................................................ 24
4.4.8. Email Applications. ......................................................................................................................... 24
4.4.9. Multimedia Player ........................................................................................................................... 24
4.5. User and Permission .......................................................................................................................... 24
4.5.1. Understanding users. ....................................................................................................................... 24
4.5.2. Permission .......................................................................................................................................... 25
4.6. Nautilus file manager ......................................................................................................................... 26
4.6.1. The Nautilus file manager window ............................................................................................ 26
4.6.2. Opening files ..................................................................................................................................... 27

Introduction to Linux 3 of 45 Faculty of Computer Science


4.6.3. Creating new folders ....................................................................................................................... 27
4.6.4. Copying and moving files and folders ....................................................................................... 28
4.6.5. File Compression ............................................................................................................................. 28
4.7. System Setting ....................................................................................................................................... 28
4.8. Session Options.................................................................................................................................... 28
5. Hands on at Command-Line (Terminal) in Ubuntu ...................................................................... 29
5.1. All about the shell ............................................................................................................................... 29
5.2. Understanding a Command-Line Session .................................................................................... 30
5.3. Absolute and Relative Paths ............................................................................................................. 30
5.4. Useful Commands ............................................................................................................................... 30
5.5. Software Management ....................................................................................................................... 33
5.5.1. How to install eclipse using the Ubuntu Software Center ................................................... 33
5.5.2. How to install the software from command-line …………………………………………......34
5.5.3. How to install eclipse using the command-line ...................................................................... 35
5.6. Network Management ........................................................................................................................ 37
5.7. User Management ............................................................................................................................... 37
5.7.1. Creating a User ................................................................................................................................. 38
5.7.2 Deleting a User .................................................................................................................................. 38
5.7.3. Modifying a User ............................................................................................................................. 38
5.8. Working with Permissions ………………………………………………………………………... 39
5.8.1. Changing File Permission ............................................................................................................. 39
5.8.2. File Permissions with chgrp.......................................................................................................... 40
5.8.3. Changing File Permissions with chown .................................................................................... 40
6. Exercises .................................................................................................................................................... 41
I. Practice: working with directories ...................................................................................................... 41
II. Practice: working with files ................................................................................................................ 41
Tables and Figures....................................................................................................................................... 42
Tables .............................................................................................................................................................. 42
Figures............................................................................................................................................................. 42
Appendix A - Ubuntu Linux System Directories ............................................................................... 43
Appendix B – Nautilus Keyboard Shortcuts ........................................................................................ 45

Introduction to Linux 4 of 45 Faculty of Computer Science


1. Introduction to Operating System

An operating system allows your PC’s hardware to communicate with the software you
run on it. It’s hundreds of programs, system libraries, drivers, and more, all tightly integrated
into a whole. In addition, an operating system lets programs talk to other programs and, of
course, communicate with you, the user. In other words, the operating system runs everything
and allows everything to work.
Some other common operating systems are Unix (and its variants BSD, AIX, Solaris,
HPUX, and others); DOS; Microsoft Windows; Amiga; and Mac OS. More properly known
as Gnu/Linux is born in 1991, when Linus Torvalds, then a computer science student at the
University of Heisinki, wanted to run a variation of Unix on his home computer. At that time,
Unix ran only on big workstations with lots of power and memory, not Intel-based personal
computers. GNU is a project established to develop a free system set UNIX-like. Using tools
from the GNU (GNU’s Not Unix) project, Torvalds was able to port a usable operating system
to PCs. He then made the source code available on the Internet, Licensed under the GNU
General Public License (GPL). Linux has been adopted to include support for non-Intel
processors and even multiple processors, sophisticated TCP/IP networking facilities such as
IP masquerading, and more. Several of Linux are now available for such computer models as
the Apple PowerPC, the DEC Alpha, the Motorola 68k, the Sun SPARC, the Mips, and many
others.

2. Introduction to Linux

Linux is a very powerful operating system which includes a multitude of tools for
programmers and system administrators. It is heavily used in the academic and scientific
communities because it is so versatile, and has over 40 years of development of scientific
tools. It is a powerful, robust, stable, and flexible system that allows programmers to tailor the
operations system to run on a variety of hardware from phones to supercomputers.

2.1. Linux History

All modern operating systems have their roots in 1969 when Dennis Ritchie and Ken
Thompson developed the C language and the Unix operating system at AT&T Bell Labs. They
shared their source code with the rest of the world, including the hippies in Berkeyley
California. By 1975, when AT&T started selling Unix commercially, about half of the source
code was written by others. The hippies were not happy that a commercial company sold
software that they had written; the resulting (legal) battle ended in there being two versions of
Unix in the Seventies: the official AT&T Unix, the free BSD Unix.
In the Eighties many companies started developing their own Unix: IBM created AIX,
Sun SunOS (later Solaris), HP HP-UX and about a dozen other companies

Introduction to Linux 5 of 45 Faculty of Computer Science


did the same. The result was a mess of Unix dialects and a dozen different ways to do the same
thing. And here is the first real root of Linux, when Richard Stallman aimed to end this era of
Unix separation and everybody re-inventing the wheel by starting the GNU project (GNU is
Not Unix). His goal was to make an operating system that was freely available to everyone,
and where everyone could work together (like in the Seventies). Many of the command line
tools that you use today on Linux or Solaris are GNU tools.
The Nineties started with Linus Torvalds, a Swedish speaking Finnish student, buying
a 386 computer and writing a brand new POSIX compliant kernel. He disclosed the source
code online, thinking it would never support anything but 386 hardware. Many people
embraced the combination of this kernel with the GNU tools, and the rest, as they say, is
history. Today more than 90 percent of supercomputers (including the complete top 10), more
than half of all smart phones, many millions of desktop computers, around 70 percent of all
web servers, a large chunk of tablet computers, and several appliances (DVD players, washing
machines, DSL modems, routers, ...) run Linux. It is by far the most commonly used operating
system in the world. Linux kernel version 3.2 was released in January 2012. Its source code
grew by almost two hundred thousand lines (compared to version 3.1) thanks to contributions
of over 4000 developers paid by about 200 commercial companies including Red Hat, Intel,
Broadcom, Texas Instruments, IBM, Novell, Qualcomm, Samsung, Nokia, Oracle, Google
and even Microsoft.
2.2. Advantages of Linux

Fewer Crashes
Linux very rarely crashes. Programs that run on top of Linux sometimes crash, but they
don’t take the rest of the system down with them.

Security
Linux is very secure. It’s built from the ground up to be secure, in fact, and Linux is based
on years of proven computer science research. It works on the principle of users who have
permissions to undertake various tasks on the system.

Free and Shareable


Another big benefit is that Linux can be obtained free of charge. After it’s installed, the
latest updates for all your programs are also free of charge. Not only that, but if you want any
new software, it will also usually be free of charge (and normally just a download away). The
software is also released under a license that indicates you can share it with anybody you want.

No Annoying Copy Protection or Usage Restrictions


A happy side effect of the sharing culture that surrounds Linux is that you’ll never need
a software registration code to install it. There’s no scheme like Windows Product Activation
(WPA) or Windows Genuine Advantage (WGA), whereby the software

Introduction to Linux 6 of 45 Faculty of Computer Science


must “phone home” over the Internet to be “activated.” The spirit of Linux users is freedom,
rather than restrictions.
2.3. Software License

There are two predominant software paradigms: Free and Open Source Software
(FOSS) and proprietary software. With proprietary software, control tends to lie more with
the vendor, while with Free and Open Source Software it tends to be more weighted towards
the end user. But even though the paradigms differ, they use the same copyright laws to reach
and enforce their goals.

2.3.1. GNU General Public License

More and more software is being released under the GNU GPL (in 2006 Java was
released under the GPL). This license (v2 and v3) is the main license endorsed by the Free
Software Foundation. Its main characteristic is the copy left principle. This means that
everyone in the chain of consecutive users, in return for the right of use that is assigned, needs
to distribute the improvements he makes to the software and his derivative works under the
same conditions to other users, if he chooses to distribute such improvements or derivative
works. In other words, software which incorporates GNU GPL software needs to be distributed
in turn as GNU GPL software (or compatible, see below). It is not possible to incorporate
copyright protected parts of GNU GPL software in a proprietary licensed work. The GPL has
been upheld in court.

2.3.2. Copyleft

Copyleft is as a special kind of copyright which imposes limits on one thing only: the
right to prevent sharing. Works registered under copyleft licenses can be used, studied, shared,
modified, and redistributed as anyone likes; but every modification or addition must be
licensed under similar copyleft terms. That way everyone benefits from the work of others,
even the original author. It’s also called a “viral” license, because it is transmitted from person
to person. No one has the right to prevent others from sharing the software. Because copyleft
granted users the right to modify the work, an important side effect was that the source code
had to be released together with the application.
2.4. Linux Distribution

A Linux distribution is a collection of (usually open source) software on top of a Linux


Kernel. A distribution (or short, distro) can bundle server software, system management tools,
documentation and many desktop applications in a central secure software repository. A distro
aims to provide a common look and feel, secure and easy software management and often a
specific operational purpose.

Introduction to Linux 7 of 45 Faculty of Computer Science


Today, there are so many Linux distributions available; over 300 distributions are described
in http://distrowatch.com/dwres.php?resource=popularity. Examples of Linux distribution are
Mint, Slackware, Debian, Ubuntu, openSUSE, Mageia, Fedora, Manjaro, Puppy, CentOS,
Red Hat, Mandriva, BOSS, Knoppix and so on.

Red Hat
Red Hat is a billion dollar commercial Linux company that puts a lot of effort in
developing Linux. They have hundreds of Linux specialists and are known for their excellent
support. They give their products (Red Hat Enterprise Linux and Fedora) away for free. While
Red Hat Enterprise Linux (RHEL) is well tested before release and supported for up to seven
years after release, Fedora is a distro with faster updates but without support.

Ubuntu
Ubuntu is based on Debian which is reliable and stable. It is the distribution with the
biggest software repositories. Ubuntu have a lot of variants such as Kubuntu, Xubuntu,
Edubuntu, Goubuntu, MIDI Ubuntu.
Canonical started sending out free compact discs with Ubuntu Linux in 2004 and quickly
became popular for home users (many switching from Microsoft Windows). Canonical wants
Ubuntu to be an easy to use graphical Linux desktop without need to ever see a command line.
Of course they also want to make a profit by selling support for Ubuntu.

Debian
There is no company behind Debian. Instead, there are thousands of well-organized
developers that elect a Debian Project Leader every two years. Debian is seen as one of the
most stable Linux distributions. It is also the basis of every release of Ubuntu. Debian comes
in three versions: stable, testing and unstable. Every Debian release is named after a character
in the movie Toy Story.

Other
Distributions like CentOS, Oracle Enterprise Linux and Scientific Linux are based on
Red Hat Enterprise Linux and share many of the same principles, directories and system
administration techniques. Linux Mint, Edubuntu and many other ubuntu named distributions
are based on Ubuntu and thus share a lot with Debian. There are hundreds of other Linux
distributions.

Introduction to Linux 8 of 45 Faculty of Computer Science


3. Introduction to Ubuntu and Installation

Ubuntu (http://www.ubuntu.com) is the natural continuation of these goals. It’s a project


founded by entrepreneur businessman Mark Shuttleworth with the intention of bringing a
freely available, high-quality operating system to the world. To this end, Shuttleworth invested
$10 million of his own money to guarantee that this will be the case for many years to come.
In 2010, the project has moved closer to becoming self-sustaining as Ubuntu becomes part of
the mainstream for desktop, Netbook, and server users. The fundamental concept is that
Ubuntu is available for use by anyone in the world, no matter who or where they are. As such,
many different languages are supported, and the operating system can also be accessed by
those with disabilities, such as partial sight or hearing. Ubuntu might just as easily be found
on a Wall Street banker’s laptop as on a battered old computer in a Brazilian favela. Ubuntu
is built around one of the most established versions of Linux: Debian. Ubuntu spread quickly,
its community rapidly grew, and soon. As of 2012, Ubuntu is installed on an estimated 2% of
the world’s computers. A new Ubuntu Desktop and Ubuntu Server release every six months
until 2022 shown in Figure 1.

Figure 1 - Ubuntu Versions and Releases

LTS means Long Term Support

There are a lot of derivatives. Some are maintained by Canonical, and some are not.
The most common are:
• Ubuntu GNOME: Ubuntu with the GNOME desktop environment.
• Kubuntu: Ubuntu with the KDE desktop environment. A good-looking system for home
and office use.
• Edubuntu: A special derivative loaded with applications for educational purposes.
• Ubuntu Studio: Designed for multimedia editing and creation
• Ubuntu Netbook Remix: A special version, targeted at mini notebooks. The desktop is
somewhat redesigned to fit smaller screens, and special care is taken to have it preloaded
with web-enabling technologies such as the Flash plug-in.

Introduction to Linux 9 of 45 Faculty of Computer Science


3.1. Why should choose Ubuntu

o Super-fast to install
o Be fully functional
o Easy to use and free
o Use a sleek and modern operating system (OS) but are reluctant to buy a Mac

3.2. Ubuntu Installation

Before you can get started with Ubuntu, you will need to obtain a copy of the Ubuntu
installation image for DVD or USB. Some options for doing this are outlined below.

3.2.1. Minimum System Requirements

Ubuntu runs well on most computer systems. Below is a list of hardware specifications
that your computer should meet as a minimum requirement.

• 2 GHz Dual core processor or better


• 2 GB of system memory
• 25 GB of disk space (at least is recommended)
• Either a DVD drive or a USB port for the installer media
• An Internet connection (highly recommended, but not required)

3.2.2. Downloading Ubuntu

The easiest and most common method for getting Ubuntu is to download the Ubuntu
DVD image directly from http://www.ubuntu.com/download.

3.2.3. 32-bit versus 64-bit

Ubuntu and its derivatives are available in two versions: 32 bit and 64 bit. This
difference refers to the way computers process information. Computers capable of running 64
bit software can process more information than computers running 32 bit software; however,
64 bit systems require more memory to do this. Nevertheless, these computers gain performance
enhancements by running 64 bit software. If your computer has a 64 bit processor, install the
64 bit version. If your computer is older, a netbook, or you do not know the type of processor
in the computer, install the 32 bit version. If your computer has a 64 bit processor, click on the
“64 bit” option before you click “Start download.”

3.2.4. Installation Methods

Ubuntu can be installed either from local installation sources (e.g., CDs or DVD or
USB) or a network based installation.

Introduction to Linux 10 of 45 Faculty of Computer Science


3.3. Installation Steps

(I) Installing Ubuntu OS on physical machine from the Ubuntu Media (physical boot
media)
1. Make sure the boot sequence in BIOS boot setting
2. Insert the medium into your CD or DVD drive or USB. At most newer computers
can boot from USB.

(II) Installing Ubuntu OS as a virtual machine from the Ubuntu Media (physical boot
media) (under Windows using virtualization Software)
1. Create a VM choosing “I will install Operating system later”
2. Power on the VM and edit VM Setting →Hardware → CD/DVD(IDE) and choose
“Use iso image file option” and browse “ubuntu-22.04.1-desktop-amd64.iso” in CD
drive. At the boot screen, select “Install Ubuntu” and follow the instructions.

Figure 2 - Welcome Screen

Note: If you choose “Try Ubuntu”, Ubuntu will then start up, running directly from the Live
CD/USB.

3. Next, you need to tell Ubuntu what kind of keyboard you are using as Figure 3. In most
cases, you will select the suggested option satisfactory. If you are unsure which keyboard
option to select, you can click the Detect Keyboard Layout button to have Ubuntu
determine the correct by asking you to press a series of keys. You can also manually choose
your keyboard layout from the list of options. If you like, enter text into the box at the
bottom of the window to ensure you are happy with your selection, then click “Continue”.

Introduction to Linux 11 of 45 Faculty of Computer Science


Figure 3 - Verify Keyboard Layout

4. Select the installation option and type.

Figure 4 – Choose Installation Option

Introduction to Linux 12 of 45 Faculty of Computer Science


Figure 5- Choose Installation Type

I. Erase disk and install Ubuntu

Use this option if you want to erase your entire disk. This will delete any existing
operating systems that are installed on that disk, such as Microsoft Windows, and install
Ubuntu in its place. This option is also useful if you have an empty hard drive, as Ubuntu will
automatically create the necessary partitions for you. Click “Continue” to continue the
installation.

Figure 6 - Erase disk and install Ubuntu

Introduction to Linux 13 of 45 Faculty of Computer Science


Figure 7 - New Partition Table

Figure 8 - Confirmation to create a Partition

After that, a new partition was created shown in Figure 9. Swap partition and ROOT
partition can be created with the desired partition size as shown in Figure 10 and Figure 11.
Similarly, the other mounting point described in Figure 12 can be separately created with the
desired size. You can see about Ubuntu file system directories in Appendix A.

Figure 9 - A Created Partition

Introduction to Linux 14 of 45 Faculty of Computer Science


Figure 10 - Swap Partition

Figure 11 - ROOT partition

Figure 12 - Ubuntu Linux System Directories

Introduction to Linux 15 of 45 Faculty of Computer Science


When the special partitions have been created, the partition table is shown in Figure 13.
Then, click “Install Now”. Creating file system is firstly processed before starting installation
as shown in Figure 14. After finishing it, the installation process will be continued.

Figure 13 - A Created Partition Table

Figure 14 - Creating File System

5. To choose the location, a world map in Figure 15 will be displayed telling Ubuntu where
you are. Or using your mouse, click your desired geographic location on the map. (You may
select the correct time zone for your location depending on the Ubuntu version.) Click
“Continue” when you are ready to move on.

Figure 15 - Choosing the Location

Introduction to Linux 16 of 45 Faculty of Computer Science


6. Ubuntu needs to know some information about you so it can set up the primary user
account on your computer as shown in Figure 16. When it is configured, your name will
appear on the login screen as well as the user menu. Click “Continue”.
Login Options
Finally, at the bottom of this screen you have three options from which to choose
regarding how you wish to log in to Ubuntu.
Log in automatically
Require my password to log in
‣ Encrypt my home folder

Figure 16 - Set up a User Account

7. Ubuntu installation now starts as follows: As the installation progresses, a slide show will
give you an introduction to some of the default applications included with Ubuntu.

Figure 17 - Starting Installation

Introduction to Linux 17 of 45 Faculty of Computer Science


Finishing Installation

8. Ubuntu will finish the installation. After approximately twenty minutes, the installation
will complete on your hard drive and you will be able to click “Restart Now” to restart your
computer and start Ubuntu.

Figure 18 - Ready to restart your computer

Log in Screen
9. After the installation has finished and your computer is restarted, you will be greeted by
the login screen of Ubuntu. The login screen will present you with your username and you
will have to enter the password to get past it.

Figure 19 - Login Screen

Introduction to Linux 18 of 45 Faculty of Computer Science


4. Understanding the Ubuntu Desktop

Initially, you may notice many similarities between Ubuntu and other operating systems,
such as Microsoft Windows or Mac OS X. This is because they are all based on the concept
of a graphical user interface (GUI)—i.e., you use your mouse to navigate the desktop, open
applications, move and perform most other tasks. In short, things are visually-oriented.
In Linux distributions (such as Ubuntu), a number of desktop environments are
available. Ubuntu uses Unity as the default desktop environment. After installing and logging
in to Ubuntu, you will see the Unity desktop. This is initial view is comprised of the desktop
background and two bars— a horizontal one located at the top of your desktop called the menu
bar, and the other bar is vertically oriented at the far left, called the Launcher.
4.1. The Menu Bar

The menu bar incorporates common functions used in Ubuntu. The icons on the far-
right of the menu bar are called the indicator area. Each installation of Ubuntu may contain
slightly different types and quantities of icons based on a number of factors, including type of
hardware and available on-board peripherals.
Network indicator allows you to manage your network connections and connect quickly and
easily to a wired or wireless network.
Keyboard indicator allows you to select the keyboard layout you would like and change your
keyboard preferences.

Sound indicator provides an easy way to adjust the sound volume as well as access your
music player and sound settings.
Clock displays the current time and provides an easy way to access your calendar and time
and date settings.
Session indicator provides an easy way to access system settings, software updates, printers,
and session options for locking your computer, logging out of your session, restarting the
computer, or shutting down completely.
User menu allows you to easily switch between different users and access your online and
user accounts.
The vertical bar of icons on the left side of the screen is called the Dock. The Dock provides
easy access to applications, mounted devices, and the Trash. All running applications on your
system will place an icon in the Dock while the application is running. By default, other
applications appear on the Dock, including LibreOffice and Firefox, the workspace switcher,
any mounted devices, and, of course, the always-important Trash lens at the bottom of the
Dock.

Introduction to Linux 19 of 45 Faculty of Computer Science


4.2. Using the Activities Menu

To run an application from the Activities menu, the application that you want to open
can search by typing in Search bar. You can also choose the workspace that the application to
open by clicking that workspace. You can also run the applications through the Dock.

Figure 20 – Activities

4.2.1. Search for files and applications in Activities


The Activities menu allows you to search your entire system for applications and files
based on your search terms. Simply type in what you remember of the name of the file or folder,
and as you type, results will show. You can narrow your search by date, by file type (.odt, .pdf,
.doc, .tex, etc.) and by only search file name.
The Files lens can also assist you in finding files or folders. The Files lens shows you the
most recent files accessed, as well as recent download.

4.3. The Dock

The Dock is a tool to help you access and find applications on your computer quickly. If
you are a Windows user, you’ll find the Dock to be a more advanced Start Menu. If you are a
Mac user, you will be familiar with it. If you’ve used a previous version of Ubuntu or another
GNOME Linux distribution, the Dock is a GNOME extension you can install it from the
GNOME Shell Extensions website (https://extensions.gnome.org). Ubuntu 22.04 is based
mostly on GNOME 42.

Introduction to Linux 20 of 45 Faculty of Computer Science


Figure 21 - Dock

4.3.1. Using the Dock

To run an application from the Dock (or cause an already-running application to


appear), just click on the application’s icon. Running applications will have one or more
red dot on the left side of the icon, indicating the number of application windows open for
this application.
Show Applications in the Dock show all installed applications and assist you in
finding applications. To explore the Show Applications, click on the lowest icon on the
Dock; the window will appear with a search bar on top. The search bar provides dynamic
results as you enter your search terms. Simply type in what you remember of the name of
the application, and as you type, results will appear.

4.3.2. Adding and removing applications from the Dock


There are two ways to add an application to the Dock:

(1) Open the application to add, and drag and drop it to the Dock
(2) Run the application you want to add to the Dock, right-click on the
application’s icon on the Dock and select Add to Favorites.

To remove an application from the Dock, right-click on the application’s icon,


then select Remove from Favorites.

Introduction to Linux 21 of 45 Faculty of Computer Science


4.3.3. Find applications

The standard Ubuntu installation comes with many applications. Users can also
download thousands more applications from the Ubuntu Software Center. As you collect an
arsenal of awesome applications (and get a bonus point for alliteration!), it may become difficult
to remember the name of a particular application. Simply use the Application lens on the Dash.
This lens will automatically categorize installed applications under “Recently Used,”
“Installed,” or “Apps Available for Download.” You can also enter a name of the application
(or a part of it), in the search bar in the Dash, and the names of applications matching your
search criteria will appear.
Even if you don’t remember the name of the application at all, type a keyword that is
relevant to that application, and the Dash will find it.
For example, type music, and the Dash will show you the default music player and any
music player you’ve used).

4.3. Applications

An application is a computer program that will allow you to perform a task such as,
create a text document or view images etc. You simply choose the appropriate application to
carry out a particular task. This sub section will recommend some alternates that will work
well on Ubuntu. Most of the applications listed in this section are available via the Software
Center.

4.3.1. Office Suites

Windows: Microsoft Office, LibreOffice


Mac os x: iWork, Microsoft Office, LibreOffice
Linux: LibreOffice, KOffice, GNOME Office, Kexi (database application)
In Ubuntu you may choose among many office suites. The most popular suite is the
LibreOffice (formerly OpenOffice). Included in the suite:

Writer — word processor


Calc — spreadsheet
Impress — presentation manager
Draw — drawing program
Base — database
Math — equation editor

LibreOffice Suite is installed by default.


Note that Base is not installed by default and it can be installed through Ubuntu Software
Center.

Introduction to Linux 22 of 45 Faculty of Computer Science


4.3.2. Working with documents, spreadsheets, and presentations
LibreOffice Suite is the default office suite when working with documents,
spreadsheets, and slide presentations.
4.3.3. Working with documents
To start the word processor, open the Dash and search for LibreOffice Writer. Then
select LibreOffice Writer.
4.3.4. Working with spreadsheets
To start the spreadsheet application, open the Dash and search for LibreOffice Calc.
Then select LibreOffice Calc.

4.3.5. Working with presentations


To start the presentation application, open the Dash and search for LibreOffice Impress.
Then select LibreOffice Impress.

4.3.6. Network Manager


Ubuntu can connect to the Internet using a wired, wireless, or dialup connection. In order
to connect to the Internet/LAN using Ubuntu, you need to use the Network Manager utility.
Network Manager allows you to turn network connections on or off, manage wired and wireless
networks, and make other network connections, such as dial up, mobile broadband, and VPNs.

Select “Enable Networking” to enable all network connections. Deselect “Enable


Networking” to disable all network connections.

Figure 22 - Network connection: (a) disconnected, (b) wired, and (c) wireless

Figure 23 - Currently connection is “Wired connection”

Introduction to Linux 23 of 45 Faculty of Computer Science


4.3.7. CD/DVD Burning

Windows: Nero Burning ROM, InfraRecorder


Mac os x: Burn, Toast Titanium
Linux: Brasero, K3b, Gnome-baker
In Ubuntu, the default application is CD burner.

4.3.8. Email Applications

Windows: Microsoft Outlook, Mozilla Thunderbird

Mac os x: Mail.app, Microsoft Outlook, Mozilla Thunderbird

Linux: Mozilla Thunderbird, Evolution, KMail

In Ubuntu, the default application is Mozilla Thunderbird.

4.3.9. Multimedia Players

Windows: Windows Media Player, VLC

Mac OS X: Quicktime, VLC

Linux: Totem, VLC, MPlayer, Kaffeine

Totem is the default media player in Ubuntu.

4.4. User and Permission

4.4.1. Understanding users


When you installed Ubuntu, a personal user account was created for you. As part
of this process, a folder named after your username was created in /home, as mentioned
previously.

Introduction to Linux 24 of 45 Faculty of Computer Science


Root user

In fact, on most Linux systems two login accounts are created during installation - a
standard user, and the root user. The root user is a special user account gifted with the ability
to do anything, such as delete system files, or install software. Its username is always root.
Normally when Linux is used on a PC, a standard user logs into the root account whenever she
has to administer the system, and then logs out when she’s finished. However, she will spend
most of her time logged into her ordinary user account, doing day-to-day stuff like browsing
the web. Ubuntu differs slightly from most Linux. Although the root account is there in the
background, the user is discouraged from directly logging in as root. Instead, the user
“borrows” root powers to administer the system when necessary. Usually, this is done by
simply entering your login password when prompted.
Note that when working at the command line(terminal), any command needing
administrative powers must be preceded by sudo.

4.4.2. Permission

Permissions can be assigned to any file / folder; they determine what types of access
other users are allowed. For example, you can ensure that a user is only able to read your file
& not edit or delete it. Every file is owned / created by a user & that user is associated with a
group that they belong to. You can set permissions for three user categories:
Owner – This is the user that created the file

Group – A group of users to which the owner belongs


Others – All others not already included

Changing File Permissions

Different permissions can be set for each of the three categories:


None – No access
Read Only – File can be accessed for reading but no changes can be made
Read & Write - Files can be modified and / or deleted & changes can be saved
Execute - Executable files can be run as a program

Right-click the FILE – Choose PROPERTIES – Select options as required

Introduction to Linux 25 of 45 Faculty of Computer Science


Figure 24 - File Properties

Changing Permissions for Folder


Changing permissions to a folder is the same process as changing file permissions;
the options are:
None – No access
List Files – User can view the folder items is not allowed access to them
Access Files – All folder items with allowable permissions can be accessed & changed.
Create / Delete Files – User can create new files & delete the files contained in the folder.

Right-click the FOLDER – Choose PROPERTIES – Select options as required

Figure 25 - Folder properties

4.5. Nautilus file manager


Just as Windows has Windows Explorer and Mac OS X has Finder to browse files and
folders, Ubuntu uses the Nautilus file manager by default.
4.5.1. The Nautilus file manager window
When you select the Home Folder shortcut in the Launcher, click on a folder in the
Dash, or double-click on a folder on the desktop, the Nautilus file manager window opens.
Nautilus keyboard shortcuts can be seen in Appendix B. The default window contains the
following features:

Introduction to Linux 26 of 45 Faculty of Computer Science


Menu bar: The menu bar is located at the top of the screen, the so called global menu. These
menus allow you to modify the layout of the browser, navigate, bookmark commonly used
folders and files, and view hidden folders and files. It also contains the Close, Minimize, and
Maximize buttons.
Title bar: The title bar shows the name of the currently selected folder
Toolbar: The toolbar contains tools for navigation. On the right is the search icon (which looks
like a magnifying glass); clicking on this icon opens a field so you can search for a file or
folder by name. Just below the toolbar, you will see a representation of your current browsing.
Left pane: The left pane of the file browser has shortcuts to commonly used folders. When a
folder is bookmarked, it appears in the left pane. No matter what folder is open, the left pane
will always contain the same folders.
Central pane: The largest pane shows the files and folders in the directory that you are
currently browsing.

Figure 26 - Nautilus File Manager Displaying Home folder

4.5.2. Opening files


To open a file, you can either double-click on its icon or right-click the icon or select
one of the Open With options.
However, if you want to open the file using an application other than what is selected,
then choose Open with Other Application. A selection of installed applications will appear.
Make your selection, and the file will open in the selected application.
4.5.3. Creating new folders
To create a new folder from within Nautilus, Click File ‣ Create New Folder.
Then, name the folder that appears by replacing the default “Untitled Folder” with your desired
label (e.g., “Personal Finances”).

Introduction to Linux 27 of 45 Faculty of Computer Science


You can also create a new folder by pressing Ctrl+Shift+N, or by right-clicking in the file
browser window and selecting Create New Folder from the popup menu (this action will also
work on the desktop).

4.5.4. Copying and moving files and folders


Copying files or folders in Nautilus by clicking Edit ‣ Copy, or by right-clicking on the
item and selecting Copy from the popup menu. When you “cut” or “copy” a file or folder,
nothing will happen until you “paste” it somewhere.

Paste will only affect the most recent item that was cut or copied. When one or more items
have been “copied,” navigate to the desired location then click Edit ‣ Paste (or right-click in
an empty area of the window and select Paste) to copy them to the new location.
4.5.5. File Compression
For most everyday users, file compression is the process of taking many files and combining
them into a single archive file that’s shrunk so it takes up less disk space. This makes the files
easier to transfer from computer to computer.
Windows: .zip, .rar
Linux: .tar, .tar.bz2, .tar.gz, .gz, .bz2

Tar has its roots in magnetic tape backup, hence the name: Tape ARchive. A tar file is simply
lots of files combined into a single large file. Tar files aren’t compressed by default, which is
to say, tar is not a compression technology. However, tar files are nearly always compressed
using add-in programs, the most popular of which are bzip2 and gzip. Tar files that are
compressed usually have double file extensions showing the type of compression used: tar.bz2
or .tar.gz. Sometimes individual files are compressed using bzip2 or gzip, without the need to
create a tar file first. If this is the case, they simply have .gz or .bz2 extensions.
4.6. System Setting

The Dash, desktop appearance, themes, wallpapers, accessibility, and other configuration
settings are available in system setting.
Appearance
You can change the background, fonts, and window theme to further modify the look and feel
of your desktop. To begin, open Appearance by either right-clicking on your background and
selecting Change Desktop Background or selecting Session Indicator ‣System Settings ‣
Appearance. Under Background, you may choose from Wallpapers, Pictures Folder, and
Colors and Gradients.

4.7. Session Options


When you have finished working on your computer, you can choose to log out, suspend,
restart, or shut down through the Session Indicator on the far right side of the top panel. You
can also quickly access these options by pressing the Ctrl+Alt+Del keys.

Introduction to Linux 28 of 45 Faculty of Computer Science


Logging out
Logging out will leave the computer running but return you to the login screen. This is useful
for switching between users, such as when a different person wishes to log in to their account,
or if you are ever instructed to “log out and back in again.”

Suspend
To save energy, you can put your computer into suspend mode, which will save its current
condition to internal memory, power off all devices, and allow you to start back up more
quickly. While in a suspended state, the computer will use just a trickle of energy; this is
required because the session is saved to internal memory, and if no power goes to internal
memory, the data will be lost.

Rebooting
To reboot your computer, select Shut Down… from the “Session Indicator” and click on
Restart.
Shut down
To totally power down your computer, select Shut Down… from the “Session Indicator” and
click on Shutdown.

5. Hands on at Command-Line (Terminal) in Ubuntu

5.1. All about the shell

When we talk about the “command-line”, we are talking about issuing typed commands
directly to Linux. The command-line offers power and flexibility, at the expense of a
slightly steep learning curve and – arguably – a lack of intuitiveness.
The command-line utilized in Ubuntu is known as bash - the Bourne Again Shell. This is
an evolved version of the Bourne sh program, one of the oldest command-line programs
for Unix. Most people agree that bash offers the best all-round mix of functionality and
ease-of- use. Command-line programs are sometimes known as shells.

Other shell programs are sometimes used under Linux instead of bash. Perhaps the most
popular are Korn Shell (ksh) and C Shell (csh). bash is the default in most popular Linux
distros.

Introduction to Linux 29 of 45 Faculty of Computer Science


5.2. Understanding a Command-Line Session

There are two ways to start a command-line session: by running a desktop terminal
program (sometimes known as a terminal emulator), or by switching to a virtual console
(also known as a virtual terminal). In both cases you are accessing exactly the same
command-line.
There are six virtual consoles, and they are accessed by hitting Ctrl+Alt and F1, F2, F3,
F4, F5 or F6. The console on F1 is used for debug and log output, so is best avoided.
Logout of the virtual console by typing exit, and switch back to your desktop (hit
Ctrl+Alt+F7). When you first open the terminal, you are in the home directory of your
user. The directory is usually something like /home/username.

5.3. Absolute and Relative Paths

You should be aware of absolute and relative paths in the file tree. When you type a path
starting with a slash (/), then the root of the file tree is assumed. The root is the base of
the Linux file system. If you don't start your path with a slash, then the current directory
is the assumed starting point. ~ symbol represents the home directory of the current user.

To know which directory you are in, you can use the “pwd” command. It gives us the
Absolute Path, which means the path that starts from the root.
uituser@uituserpc:~$ pwd
/home/uituser
uituser@uituserpc:~$ cd home
bash: cd: home: No such file or directory
uituser@uituserpc:~$ cd /home/
uituser@uituserpc:/home$ pwd
/home

5.4. Useful Commands

Table 1 lists typical useful commands that are commonly used in Ubuntu, along with
popular command options.

Introduction to Linux 30 of 45 Faculty of Computer Science


Table 1 - Typical Useful Commands

Command Description
ls List files and folders.
Syntax : ls [-option]
-l : Long listing (show permissions, ownerships, etc.)
-a: Show all files, including hidden files
-h: Show KB, MB etc, rather than bytes.
Example: ls –l
touch Create a file.
Syntax: touch filename
Example: touch myfile.txt
mkdir Create a folder.
Syntax: mkdir foldername
Example: mkdir myfolder
cat Display content of a file
Example: cat file1.txt
cat file1.txt file2.txt
cat> Inserting text typed in console to a file. Press Ctrl+D after typing
text.
Example: cat > file1.txt
cat>> Appending text typed in console to a file. Press Ctrl+D after
typing text.
Example: cat >> file1.txt
cd 1. Change folder to given path
Syntax: cd [paths if necessary] foldername
Example: cd /home/Documents
2. Type cd .. to change to parent folder.
Example: cd ..
3. Type cd to change to current user’s home folder
(/home/username)
Example: cd
clear Remove all previous commands and output from consoles
cp Copy file or folder, first specify file (and path if necessary) and
specify destination. Note that use –r option to copy folders to
somewhere.
Syntax: cp sourcefile destination
Example: cp myfile.txt Desktop/
mv Move file or folder; can also be used to rename files/folders if a
new destination isn’t specified. Note that, unlike cp, it is not
necessary to specify the –r option in order to move folders.
Syntax: mv myfile.txt Desktop/
Example: mv oldfile.txt newfile.doc

Introduction to Linux 31 of 45 Faculty of Computer Science


rm Delete file(s) or folder(s); multiple files/folders can be specified.
-r: Delete folder; must be used if a folder is to be deleted
-f: Force deletion; don’t prompt user for confirmation when
deleting
Syntax: rm filename/foldername
Example: rm –r newfile.doc
rmdir Remove empty directory. Will not remove the directory if it is
not empty.
Use rm –r to remove a directory and all its contents recursively.
Example: rmdir folder1
ln Create a link to a file (similar to a shortcut under Windows); first
specify the file (including path if necessary), and then the
location where the link should be created. A different filename
may be specified for a new link.
-s: Create symbolic link, rather than hard link.
Syntax: ln [option] filename location
Example: ln –s myfile.txt ~/Desktop/
less Open specified plain text file in a viewer.
Syntax: less filename
Example: less myfile.txt
head Outputs the first part, or "head", of files.
Syntax: head –n filename
Example: head -2 myfile.txt(Output first 2 lines of myfile.txt)
tail Outputs the last part, or "tail", of files.
Syntax: tail –n filename
Example: tail -2 myfile.txt(Output last 2 lines of myfile.txt)
man View the manual page for specified command.
Syntax: man command
Example: man ls
df Show amount of free disk space on all attached filesystems
Syntax: df
[option]
Example: df –h
free Show amount of free memory.
Syntax: free [option]
Example: free –mt
grep Search through specified file for a word or phrase.
-i: ignore upper/lowercase when searching
Syntax: grep [option] searchedword filename
Example: grep –i hello greeting.txt
nano Simple text editor that’s ideal for creating, editing or viewing
files.
Syntax: sudo nano filename
Example: sudo nano ~/Desktop/myfile.doc
Introduction to Linux 32 of 45 Faculty of Computer Science
umount Unmount attached storage device. The command is umount
and not unmount. Needs root powers.
Syntax: sudo umount mountpoint
Example: sudo umount /media/cdrom
locate Find the specified file; relies on a background database that is
periodically and automatically update. The database can be
manually updated by typing the sudo updated command.
Syntax: locate searchedfile
Example: locate myfile.txt
passwd Change the password. Without username, root password will be
changed.
Syntax: passwd username
Example: passwd uituser
history See a list of typed command at the prompt.
exit Log out of current session. If you have jobs running in the
background, the shell will remind you that they are running. In
this case, issuing exit again will terminate those jobs and exit the
shell.
Syntax: exit

5.5. Software Management

Like many versions of Linux, Ubuntu relies on a system called package management
for all its software installation and removal needs.

5.5.1. How to install eclipse using the Ubuntu Software Center

To install an application, first you need to find it. This is made easy by the Center’s
browsing and searching mechanisms, and by the fact that Ubuntu maintains all applications in
a catalog containing information about the applications available from all configured software
sources.

The list of available software from the repositories should be updated before any
software installation. This can be done by Software Updater. Type “Updater” in Dash and
Software Updater application will appear then click to run it.

You can find eclipse by Software Center All Software Developer Tools IDEs. Before
installing eclipse IDE, check whether Java is installed or not by checking Installed software list.
(Software Center Installed). If Java hasn’t been installed, install Java first. (Software Center All
Software Developer Tools).
When you find the application that you want to install, just select it from the list and press
the Install button that appears at the right end of the application’s row.

Introduction to Linux 33 of 45 Faculty of Computer Science


You’ll be prompted for your password, and the application will start installing. A progress
bar will appear above the Install button, and a new element labeled In Progress will emerge in
the navigation pane. Once it has finished installation, the progress bar disappears, the Install
button is replaced with a more appropriate Remove button, and the In-Progress element
disappears.

Figure 27 - Software Center


Can you guess how to uninstall your application? By pressing that Remove button.

5.5.2. How to install the software from command-line


Packages are installed and removed using Ubuntu’s two software subsystems: the
Advanced Packaging Tool (APT) and the Debian Package system (dpkg).

Introduction to Linux 34 of 45 Faculty of Computer Science


5.5.3. How to install eclipse using the command-line

Before installing eclipse IDE, check whether Java is installed or not. Use the
following command in terminal to check it.

root@uituserpc:~# java --version


or
uituser@uituserpc:~$ java --version

If you get the following output that means Java is not installed on your Ubuntu
22.04. You need to install Sun JDK or Open JDK using Ubuntu Software Center or
using the following commands.

root@uituserpc:~# apt-get install


or
uituser@uituserpc:~$ sudo apt-get install

And if you get the following output that means you have installed java in your OS.

Introduction to Linux 35 of 45 Faculty of Computer Science


Second, if you are installing Eclipse IDE for C/C++, you also need to check whether
g++ is installed or not. To check whether g++ is installed or not you need to run the following
command in the terminal.
root@uituserpc:~# g++ --version
or
uituser@uituserpc:~$ g++ --version

If you get the following output, you need to install g++ using apt install g++.

If you get the following output, g++ has already installed.

After that, execute the following snap command to install the Eclipse IDE.

Example:
sudo snap install –classic eclipse
- Eclipse2022-09 from snapcrafters installed-

Introduction to Linux 36 of 45 Faculty of Computer Science


After installation has completed, use the top left Activities menu to search for eclipse
application. Click on the relevant icon to start the Eclipse IDE.

Figure 28 – Launching Eclipse IDE

5.6. Network Management

ifconfig – show network information


iwconfig – show wireless information
sudo iwlist scan – scan for wireless networks
nmcli device status – status network configuration
– restart network configuration

nmcli networking off


nmcli networking on

5.7. User Management

User management on any Unix can be done in three complimentary ways. You can use the
graphical tools provided by your distribution. These tools have a look and feel that depends
on the distribution. If you are a novice Linux user on your home system, then use the
graphical tool that is provided by your distribution. This will make sure that you do not
run into problems.

Introduction to Linux 37 of 45 Faculty of Computer Science


Another option is to use command line tools like useradd, usermod, gpasswd, passwd and
others. Server administrators are likely to use these tools, since they are familiar and ver y
similar across many different distributions. This section will focus on these command line
tools.
User entries are kept in /etc/passwd file. User passwords are encrypted and kept in
/etc/shadow. The /etc/shadow file is read only and can only be read by root.

5.7.1. Creating a User

When a Linux system administrator creates a user, an entry in /etc/passwd for the user is
created. The system also creates a directory, labeled with the user’s username, in the /home
directory. You can create a user by useradd command. You can use option -m to create
home directory itself (user folder mayn’t be automatically created based on setting file), -
d option to have a home folder in a different place and –c option to provide full name of
the user or the short description about the user. For example,

root@ uituserpc:~# useradd -m -d /home/testuser -c "Testing User" testuser

root@ uituserpc:~# tail -1 /etc/passwd


testuser:x:1003:1003:Testing User :/home/testuser:/bin/sh

5.7.2 Deleting a User

You can delete the user with userdel. The -r option of userdel will also remove
the home directory.
For example,
root@uituserpc:~# userdel -r testuser

5.7.3. Modifying a User

You can modify the user with usermod. You can use –c to add comment.
For example,
root@uituserpc:~# tail –l /etc/passwd
testuser:x:1003:1003:Testing User :/home/testuser:/bin/sh
root@uituserpc:~# usermod -c 'Test User1' testuser
root@uituserpc:~# tail -1 /etc/passwd
testuser:x:1003:1003:Test User1 :/home/testuser:/bin/sh

Introduction to Linux 38 of 45 Faculty of Computer Science


5.8. Working with Permissions

Under Linux (and UNIX), everything in the file system, including directories and devices,
is a file. And every file on your system has an accompanying set of permissions based on
ownership. These permissions provide data security by giving specific permission
settings to every single item denoting who may read, write, or execute the file. These
permissions are set individually for the file’s owner, for members of the group the file
belongs to, and for all others on the system. You can examine the default permissions for
a file you create by using the umask command, which lists default permissions using the
number system explained next, or by using the touch command and then the ls
command’s long-format listing like this:
uituser@ uituserpc:~$ touch myfile
uituser @ uituserpc:~$ ls -l myfile
-rw-r--r-- 1 uituser uituser myfile 0

The mnemonic forms of chmod’s options are (when used with an equal sign, =, to set
the permission exactly, a plus sign, +, to add, or a minus sign, -, to remove):
. u—Adds or removes user (owner) read, write, or execute permission.
. g—Adds or removes group read, write, or execute permission.
. o—Adds or removes read, write, or execute permission for others not in a file’s group.

. a—Adds or removes read, write, or execute permission for all users. (7 in Octal
permission notation)
. r—Adds or removes read permission. (4 in Octal permission notation)
. w—Adds or removes write permission. (2 in Octal permission notation)
. x—Adds or removes execution permission. (1 in Octal permission notation)

5.8.1. Changing File Permission


You can use the chmod command to change the access permission of a file. Following
example gives read, write and execute permission to owner and read only permission to
group and others.

uituser @ uituserpc:~$ chmod 744 myfile (or)


uituser @ uituserpc:~$ chmod u=rwx,g=r,o=r myfile

Introduction to Linux 39 of 45 Faculty of Computer Science


To give additional write permission to group and others, you can use the following
command.

uituser @ uituserpc:~$ chmod go+w myfile

5.8.2. File Permissions with chgrp

You can use the chgrp command to change the group to which a file belongs:
uituser @ uituserpc:~$ chgrp students myfile

5.8.3. Changing File Permissions with chown

You can use the chown command to change the owner of a file:
uituser @ uituserpc:~$ chown student1 myfile

You can also use the chown command to change the group of a file at the same time:
uituser @ uituserpc:~$ chown student1:students myfile

Introduction to Linux 40 of 45 Faculty of Computer Science


6. Exercises

I. Practice: working with directories

1. Display your current directory.


2. Change to the /etc directory.
3. Go to the parent directory of the current directory.
4. Go to the root directory.
5. List a long listing of the root directory.
6. Stay where you are, and list the contents of /etc.
7. Stay where you are, and list the contents of /usr /sbin.
8. Stay where you are, and list the contents of ~.
9. List all the files (including hidden files) in your home directory.
10. List the files in /boot in a human readable format.
11. Create a directory testdir in your home directory.
12. Change to the /etc directory, stay here and create a directory newdir in your home
directory.
13. Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory from
dir2, and dir2 is a subdirectory from dir1).
14. Remove the directory testdir.
15. Remove the directory dir1 in one command.

II. Practice: working with files

1. List the files in the /bin directory


2. Display the type of file of /bin/cat, /etc/passwd and /usr/bin/passwd.
3. Create a directory ~/touched and enter it.
4. Create the files today.txt and yesterday.txt with 5 text lines each in “touched”
directory.
5. Copy yesterday.txt to copy.yesterday.txt
6. Display first 3 lines of yesterday.txt.
7. Rename copy.yesterday.txt to bakup.yesterday.txt
8. Make backup.yesterday.txt read only for all users.
9. Add write permission to backup.yesterday.txt for owner.
10. Find the word “today” in today.txt by case insensitive manner.
11. Create a directory called ~/testbackup and copy all files from ~/touched into it.
12. Use one command to remove the directory ~/testbackup and all files into it

Introduction to Linux 41 of 45 Faculty of Computer Science


Tables and Figures

Tables
Table 1 - Typical Useful Commands .................................................................................................... 31

Figures
Figure 1 – Ubuntu Versions and Releases........................................................................................... 9
Figure 2 – Welcome Screen .................................................................................................................... 11
Figure 3 – Verify Keyboard Layout ...................................................................................................... 12
Figure 4 – Choose Installation Option.................................................................................................. 12
Figure 5 – Choose Installation Type ..................................................................................... 13
Figure 6 – Erase disk and install Ubuntu ............................................................................................. 13
Figure 7 – New Partition Table ............................................................................................................. 14
Figure 8 – Confirmation to create a Partition ..................................................................................... 14
Figure 9 – A Created Partition .............................................................................................. 14
Figure 10 – Swap Partition ...................................................................................................................... 15
Figure 11 – ROOT partition .................................................................................................................... 15
Figure 12 – Ubuntu Linux System Directories .................................................................................. 15
Figure 13 – A Created Partition Table ................................................................................................. 16
Figure 14 – Creating File System .......................................................................................................... 16
Figure 15 – Choosing the Location ....................................................................................................... 16
Figure 16 – Set up a User Account ........................................................................................................ 17
Figure 17 – Starting Installation ............................................................................................................. 17
Figure 18 – Ready to restart your computer ....................................................................................... 18
Figure 19 – Login Screen ......................................................................................................................... 18
Figure 20 – Activities ............................................................................................................................... 20
Figure 21 – The Dock .............................................................................................................................. 21
Figure 22 – Network connection: (a) disconnected, (b) wired, and (c) wireless ..................... 23
Figure 23 – Currently connection is “Wired connection” ........................................................... ..23
Figure 24 – File Properties....................................................................................................................... 26
Figure 25 – Folder Properties.................................................................................................................. 26
Figure 26 – Nautilus File Manager Displaying Home folder ......................................................... 27
Figure 27 – Software Center ................................................................................................................... 34
Figure 28 – Launching Eclipse IDE ...................................................................................................... 37

Introduction to Linux 42 of 45 Faculty of Computer Science


Appendix A - Ubuntu Linux System Directories

/bin: This directory contains important binary application. It would contain the
executable file for command like ls, cal, grep etc which are used in everyday Linux
environment, directly or indirectly.
/boot: This directory contains the files needed for booting up the operating system. It include
the kernel (vmlinux), ramdisk image (initrd.lz) and bootloader configuration files.

/dev: This Ubuntu Linux directory does not consume any space on disk and is used to keep
track of devices connected to the computer including the ones which are a part of the CPU
such as the disks, mouse, display, graphics card etc.
/etc: This is the place where you can find the configuration files of the base OS and other
installed applications and startup scripts. It contains all the configuration files, ranging from
the ones which control the booting of computer to the ones which can change the behavior
of installed software and services.
/home: It is the user profile folder in Linux similar to the c:/ user folder in Windows. Each
user on the system would have a separate directory within this sub-directory.
/lib: The system libraries required for the proper functioning of installed software are present
in this Linux directory. 'Library' in context of computing is define as a reusable resource that
can be used by more than one software.
/lost+found: This contains the lost and found files of your / directory.
/media:This directory is not a part of the Linux directory structure. It is the system directory
file which help to recognize all the mounted removable media such as CD, external hard
drives, USB drives, cameras etc.
/mnt: This Linux directory is used to create mount point for other systems which are
attached to the computer on boot, e.g. Windows partitions.
/opt: This directory provides a location for optional applications to
be installed.
/proc: This virtual directory does not consume any space on disk but exists only in the
system memory. This directory is freely available for browsing only to the 'root' user. root:
This is commonly known as the slash-root directory, it refers to '/' as root in Ubuntu
Linux.
/sbin: This directory is also available to root user. It contains commands to change system
wide settings.
/srv: This directory acts as a temporary location for data meant to be used by servers.
/sys: This directory contains system-specific information meant as reference for other
applications.
/tmp: As the main suggest, it acts as storage for temporary files.
/usr: This is where most of your applications and files will be stored, as anything present
here is available for all users to access. It can also be called as the program files folder for
Linux.
Introduction to Linux 43 of 45 Faculty of Computer Science
/var: This is a directory for variable files such as logs and databases. Notice the
contrast with the /tmp directory.

The root level directory is represented simply by the slash /. At the root level, all Ubuntu
systems include these directories:

Directory Content

bin Essential command binaries


boot Static files of the boot loader
dev Device files
etc Host-specific system configuration
home User home directories
lib Essential shared libraries and kernel modules
media Contains mount points for replaceable media
mnt Mount point for mounting a file system temporarily
proc Virtual directory for system information (2.4 and 2.6 kernels)
root Home directory for the root user
sbin Essential system binaries
sys Virtual directory for system information (2.6 kernels)
tmp Temporary files
usr Secondary hierarchy
var Variable data
srv Data for services provided by the system
opt Add-on application software packages

Introduction to Linux 44 of 45 Faculty of Computer Science


Appendix B – Nautilus Keyboard Shortcuts

Keyboard combination Action


Alt+left cursor Move back in the file browsing history
Alt+right cursor Move forward in the file browsing history
Alt+up cursor Switch to the parent folder of the one you’re currently in
Alt+Home Switch to the user’s/home folder
F5/Ctrl+R Refresh the file listing, showing any changes made since the
listing appeared
Ctrl+=/Ctrl++ Zoom in (show more details)
Ctrl+- Zoom out (show fewer details) Ctrl+0
Ctrl+0 (zero) Zoom to default level
Ctrl+W Quit file browsing window
Shift+Ctrl+W Quit All file browsing windows
Ctrl+N New browsing window
Ctrl+D Add current location as bookmark
Ctrl+B Edit bookmarks
Ctrl+T New tab (Ubuntu 8.10 and above)
Ctrl+A Select all files
F2 Rename selected file/folder
Ctrl+O Open selected file/folder
Ctrl+l/Alt+Enter Show properties of selected file/folder
Ctrl+Shift+N Create new folder
Delete Move selected item to Wastebasket (Trash)
Shift+Delete Permanently delete selected item (bypass Wastebasket)
F9 Show/hide side pane
Ctrl+1 Switch to icon view
Ctrl+2 Switch to list view
Ctrl+3 Switch to compact view (Ubuntu 8.10 and above)
Ctrl+H Show/hide hidden files
Ctrl+L Go to location (effectively, switch to text-based location bar rather
(or hit forward slash) than button mode; hit Esc to switch back)

Introduction to Linux 45 of 45 Faculty of Computer Science

You might also like