You are on page 1of 5

SCHO0OL OF COMPUTING SCIENCE AND ENGINEERING

• SUBJECT CODE: CSD4003


NETWORK AND SYSTEM SECURITY LAB WORKBOOK

19BCY10178

Lab 3: Basics of Linux and VI text editor


Date of the Session: ___/___/___ Session Time:_____to______

Learning outcome:
• Understanding the Linux architecture
• Understanding how to use command line interface
Pre-Lab Task:
• Explain the history of Linux in a short note?

Linux is a computer operating system developed by Linus Torvalds, it was a


personal project of his. His main goal was to create a new free operating system
kernel.

It has grown from a small number of C files under a license prohibiting


commercial distribution to the 4.15 version in 2018 with more than 23.3 million
lines of source code, under the GNU General Public License v2.

Torvalds began developing Linux while still a student at the University of Helsinki,
with the goal of creating a system that would be similar to MINIX, a UNIX
operating system. He released version 0.02 in 1991.

In 1994, the Linux kernel, which is at the heart of the operating system, was
released in version 1.0. Around the same time, American software developer
Richard Stallman and the Free Software Foundation (FSF) began working on GNU,
an open-source UNIX-like operating system. Unlike Torvalds, Stallman and the FSF
began by developing operating system tools first.

These utilities were then added to the Linux kernel to create a complete system
called GNU/Linux, or, less precisely, just Linux.
• Difference between Linux and UNIX?

Comparison Linux Unix


Definition It is an open-source operating system It is an operating system
which is freely available to everyone. which can be only used by its
copyrighters.

Examples It has different distros like Ubuntu, IBM AIX, HP-UX and Sun
Redhat, Fedora, etc Solaris.

Users Nowadays, Linux is in great demand. It was developed mainly for


Anyone can use Linux whether a servers, workstations and
home user, developer or a student. mainframes.

Usage Linux is used everywhere from It is used in servers,


servers, PC, smartphones, tablets to workstations and PCs.
mainframes and supercomputers.
Cost Linux is freely distributed, Unix copyright vendors decide
downloaded, and distributed through different costs for their
magazines also. And priced distros of respective Unix Operating
Linux are also cheaper than Windows. systems.

Development As it is open source, it is developed Unix was developed by AT&T


by sharing and collaboration of codes Labs, various commercial
by world-wide developers. vendors and non-profit
organizations.
Manufacturer Linux kernel is developed by the Unix has three distributions
community of developers from IBM AIX, HP-UX and Sun
different parts of the world. Although Solaris. Apple also uses Unix to
the father of Linux, Linus Torvalds make OSX operating system.
oversees things.
GUI Linux is command based but some Initially it was command based
distros provide GUI based Linux. OS, but later Common
Gnome and KDE are mostly used GUI. Desktop Environment was
created. Most Unix
distributions use Gnome.

Interface The default interface is BASH (Bourne It originally used Bourne shell.
Again SHell). But some distros have But is also compatible with
developed their own interfaces. other GUIs.
File system Linux supports more file system than It also supports file system but
support Unix. lesser than Linux.

• What is a kernel in operating system?

Kernel is central component of an operating system that manages operations of


computer and hardware. It basically manages operations of memory and CPU
time. It is core component of an operating system. Kernel acts as a bridge
between applications and data processing performed at hardware level using
inter-process communication and system calls.

In Lab Task:
Harsha was so confused with the kali Linux he is not understanding how to use terminal he was
so confused with the Linux architecture now help Harsha to understand how to navigate
between the directory, how to list all the files in the directory, print the present working
directory, create an new directory and also explain how file system is organized in Linux.

Linux is easy once he get enough practice, for file navigation there are certain commands like
“cd”: to change directory. Eg: cd /Desktop: to go to Desktop
“cd /<folder name>”: to proceed next folder in the folder.
“Cd /d E:”: To change the directory in Linux.
“ls”: To display all files and folders.
“mkdir”: to create new directory.
“rmdir”: to remove directory.

Post Lab Task:


Harsha now has some basic knowledge on Linux and its architecture but Harsha was so
confused about the text editor in Linux although there are other GUI editors available in Linux
but Harsha was more concerned about CUI text editor now help Harsha to understand how to
use “vi” a CUI text editor prebuilt in most of the Linux distro’s .

CLI vi can be operated with following commands


$ vi <filename> Open or edit a file.
i Switch to Insert mode.
Esc Switch to Command mode.
:w Save and continue editing.
:wq or ZZ Save and quit/exit vi.
:q! Quit vi and do not save changes.
yy Yank (copy a line of text).
p Paste a line of yanked text below
the current line.
o Open a new line under the current line.
O Open a new line above the current line.
A Append to the end of the line.
I Insert text at the beginning of the current
line.
b Go to the beginning of the word.
e Go to the end of the word.
x Delete a single character.
dd Delete an entire line.
Xdd Delete X number of lines.
Xyy Yank X number of lines.
G Go to the last line in a file.
XG Go to line X in a file.

(For Evaluator’s use only)


Comment of the Evaluator (if Any)

Evaluator’s Observation
Marks Secured: _______ out of ________

Full Name of the Evaluator:

Signature of the Evaluator Date of Evaluation:

You might also like