You are on page 1of 25

Practicum Module Of

Operating System

Fundamental

2021

Module 2
OS Process, Vi Editor and

Network Configuration
ASSISTANT
Ananda Anggie Nur Aini
GIE

Arya Bimo Bagas penggalih


BMO

Farras Naim
RAS

Faris Aufar Putra


AIS

Fie Alfain Nuril Haque


FIE

Fitria Nikmatul Hidayah


WPN

Maulana Malik Ibrahim


ANA

Milenia Ari Oktaviana


MLN

Muhammad Fakhrul Safitra


DFA

Muhammad Hafiz Hawarizmi


VIS

Muliya Dewi
MYD

Ni Made Meliana Listyawati


NML

Nurul Annisa
ICE

Riski Ananda Widiya Putri


RAA

Rizal Indera
RZL

Rizky Fadilah
RIZ

Syarah Tazkiatun Nupus


TAZ

Wiratama Putra Prakosa


OSA

I. Practicum Objectives
1.1 Practicant is able to understand the Operating System process.
1.2 Practicant is able to understand the definition, usage, and utilization of Text Editor
1.3 Practicant is capable to operate Text Editor
1.4 Practicant is capable of perorm Network Configuration

II. Tool and Material


2.1 PC/Laptop
2.2 ISO CentOS 7.6
2.3 VMWare Workstation 15.x / 16

III. Theoretical Basis


3.1 OS Process
3.1.1 Definition
OS Process is a program that being executed. Process is the
smallest work unit that has resources individually and scheduled by the
operating system. The operating system plays a role in managing all
running process and allocating the resources required by them. Two or
more processes can run simultaneously, where each process gets its own
parts of memory and control. The process has two principles, that is
Independent and One Program at any instant. Independent means that the
programs are not dependent on each other, while One Program at any
instant means only one process is served by the processor at a time.
The processes managed by the operating system will go through a
series of circumstances that are part of its activities. The state of this
process is referred to as the status of the process consisting of:
Table 2.1 Process Status

STATUS Explanation
New The process is being created.
The process is ready to execute but the CPU is not yet available
Ready because it is working on another process.
The process is waiting for a specific event. For example,
Waiting
waiting for the I/O operation to complete.
The process is executed. At this status the CPU is executing
Running the instructions on the process.
Terminated The process ends.

1
3.1.2 Process Creation Concept
The concept of process creation on Linux operating systems:
a. Each process is assigned a special number as identification called
Process Identification or PID in the form of a unique integer number.
b. If the process is completed (Terminated) then all resources used
including PID are freed back.
c. The process is created using a call system fork() often called forking
the process.
d. System call fork(), copy the caller process so that there are two
processes, namely PARENT (caller process) and CHILD (copy
process).
e. The CHILD process is identical to its PARENT process but has a
different PID.
f. After a new process (CHILD) is successfully executed resumed
normally in each process on the line after the system call fork() call.
g. The caller process (PARENT) can forking the process more than once,
allowing many CHILD processes to be executed. Child process can
forking the process as well as PARENT so that it can form the
structure of the process tree.

3.1.3 Process Management


The function of process management is to view, run, or stop any
processes that are running when we run the operating system. The
following are common commands that are used when management of
processes.

a. Command “ps”
Process Status or "ps" command is used to display the current
process on the system. This command has a disadvantage of not being
interactive. To execute the command "ps" can be done on the terminal
in the following ways:
[root@sisjarlab sisjar]#ps

2
Image 2.1 “ps”command after executed

b. Command “top”
“top” command is used for managing Linux process without
using GUI. When executed, it will display a list of all running processes
and every second will be updated (default scanning is 3 seconds). This
command is more interactive than the "ps" command. To execute the
"top" command can be done on the terminal in the following ways:
[root@sisjarlab sisjar]#top

Image 2.2 “top” command after executed

3
c. Command “kill”
In certain cases, we can stop the process forcibly, for example,
when the resource usage from a process is too high. To execute the “kill”
command, it could be done on the terminal in the following ways :
[root@sisjarlab sisjar]#kill [-signal] [PID]

Example:
[root@sisjarlab sisjar]#kill -9 23112

Image 2.3 “kill” command after executed in PID Firefox

Explanation: the discontinued process is the top process with PID 23112.
[-signal] is a specific parameter sent to the process. We can use a signal
with a number (such as 9) or a name (such as SIGKILL). 9 or SIGKILL
causes the exit process without shutdown the task.

3.2 Text Editor


3.2.1 Definition
Text Editor is a program or software that used to edit text. Most
text editors are used to write lines of code, edit configuration files, and
much more. The text editor itself is installed by default on each operating
system. On Linux, text editors are divided into two types: text editors that
use Graphical User Interface (GUI) and text editors that use Command
Line (Console/Terminal).

4
3.3 Variant
3.3.1 Nano Editor
GNU Nano is a text editor used on Unix-based operating systems,
the Nano view editor using the Command Line Interface. Nano is a clone
of Pico so it aims to emulate the functionality and easy use of Pico's
interface. Unlike Pico, Nano editors are licensed under the GNU General
Public License (GPL) and released as free software.
a. Commands and How it Works
Nano editor can be used easily, so users can type directly to
enter text. The nano editor uses the control key as its way of operation,
so it's called keyboard-oriented. If the user is confused in the use of
Nano editor can by way of Ctrl+G then it will be taken to the help page.
To enter into nano editor can be done by entering the following
command in the terminal:
[root@sisjarlab sisjar]#nano [FileName]

Example:
[root@sisjarlab sisjar]#nano pantun.txt

Image 2.4 Command on the terminal

5
Image 2.5 Characteristic of Nano Editor

3.3.2 Vi Editor
Vi editor is one of the text editors originally created for the Unix
operating system. The name Vi (pronounced "vee-ai") is derived from the
visual abbreviation. Vi editor itself is a fast and powerful text editor first
developed by William (Bill) Joy.
a. Commands and How it Works
Vi editor has a screenoriented way of operating using the
terminal text editor. The vi editor operation is divided into three modes,
including Command Mode, Insert Mode, and Command-Line Mode.
Each mode shift can only be done in Command Mode, so it does not
allow Insert Mode to move to Command-Line Mode without going
through Command Mode first and vice versa. Here's an explanation of
each mode:
1. Command Mode
This mode is the initial mode when Vi editor is run.
Functions that can be performed in this mode include navigating
using cursors on written files, editing lines and words, and as a
reference to mode shifts. Unlike other modes, commands in this
mode can be executed without the need to press enter. To enter into
Vi editor can be done by entering the following command in the
terminal:
[root@sisjarlab sisjar]#vi [FileName]

Example:
[root@sisjarlab sisjar]#vi lyrics.txt

6
Image 2.6 Command on the terminal

Once the above command has been successfully executed it


will display a new file with the file name yourname.txt in the Vi
editor, the following view is the view in Command Mode.

Image 2.7 Command Mode Vi Editor

7
The commands that can be run in this mode are :
Table 2.2 Command in Command Mode

Command Description
Search
Repeat the previous search on the cursor and
n
afterwards.
Repeat previous search on cursor and previous
N

Delete
dd Delete all text in cursor line.
ndd Remove all n number text on cursor line.
D Delete all text aftercursor.
dw Delete the word on the cursor is located.
Remove the n-word on the cursor and
ndw
afterwards.
x Remove characters in cursor.
Remove n characters on cursor and
nx
afterwards.
X Remove characters before cursor.
Delete words in cursor while moving to
cw
Insert Mode.
Replace (→ Then type)
r→n Replace characters on cursor with n.
Replace characters on cursor and afterwards a
nr → x
number of n with x characters. .
Append (→ Then type)
Add n after cursor at once
a→n
berpindah ke Insert Mode.
Line
Add a new row after the cursor row is at once
o
moving into Insert Mode.
Add a new row before the cursor row is at once
O
Moving into Insert Mode.

8
Undo/Repeat
U Undo activity on cursor row is located.
. (dot) Do the previous command on cursor.
Copy/Paste
yy Copy the row on the row where the cursor is
located.
Copy row number n on cursor row is located and
nyy
after.
Add the contents of the clipboard to the cursor
p
and afterwards.
Cursor
Key → Move the cursor to the right.
Key ← Move the cursor to the left.
Key ↑ Move the cursor up.
Key ↓ Move the cursor down.
Move the cursor to the end of the cursor
$ atau [end]
row.
Move the cursor to a sentence after the cursor
w
position.
Move the cursor to a sentence before the cursor
b
position.
Any use of the above command in both capital and non-
capital letters is case sensitive.
2. Insert Mode
Insert Mode is a mode that has a function to insert typed
characters into a previously created file. Commands in Command
Mode and Command-Line Mode will not work
After successfully creating a file and entering in Command
Mode, to switch mode to Insert Mode press the letter [i] on the
keyboard, then write a word or sentence on the file.

9
Image 2.8 Insert Mode Vi Editor

To exit this mode, use the [esc] key. Cursor navigation


in Insert Mode using arrow key as in Command Mode.

3. Command-Line Mode
This mode has a wider scope of functions in manipulating
or editing files as a whole. To enter this mode, enter the characters
":" or "/" or "?" and then the command to use. To check if it has
entered Command-Line Mode is to look at the bottom of the Vi
editor where the cursor will move to the bottom row along with the
character that has been typed. Unlike Command Mode, this mode
will execute the command after pressing enter. This mode cannot
execute more than one command line. In the image below the
command entered is a command to save the file and exit vi editor.

10
Image 2.9 Display Command-Line Mode

Commands that can be executed in this mode include:

Table 2.3 Command in Command-Line Mode

Command Description
W Save file changes
Save file changes and ignore errors that appear
w!
in the process
Q Quit Vi editor
Quit Vi editor and ignore errors that appear in
q!
the process
Save file changes then exit Vi editor
wq
/n Search for a character or n-word after cursor
?n Find the character or n-word before the cursor
Find the character or n-word after the cursor,
/s/n/m
then replace it with m

When you have successfully saved the file, to display the


contents of the saved file using the command::
[root@sisjarlab sisjar]#cat [FileName]

Contoh:
[root@sisjarlab sisjar]#cat lyrics.txt

11
Image 2.10 Tampilan isi file dengan command “cat”

To find out more explanations of Vi editor can use command:


[root@sisjarlab sisjar]#vimtutor

3.4 Network Configuration


This material contains how to do configuration the network interface
contained in operating system used, especially for Server Administrators by
using the command line or text user interface.
3.4.1 Ethernet Interface
Ethernet interfaces are identified by the system using the common
naming of "ens33". This ethernet interface can be changed according to its
needs and usage.

3.4.2 IP Addressing
a. Network Manager Command Line Interface (NMCLI)
NMCLI is a command line tool to control Network Manager.
This NMCLI tool can be used to add or create new IP addresses, modify
available IP addresses, and remove IP addresses. Changes to the
NMCLI are temporary, so that when the operating system restarts, the
IP address configuration will return in its original state.
b. Network Manager Text User Interface (NMTUI)
NMTUI is a TUI application that is installed by default on
CentOS that is used to modify ip addresses on CentOS. Changes to
NMTUI are permanent and it is highly recommended to use them.

12
IV. Lab Praktik
4.1 Text Editor
4.1.1 Vi Editor
Toni is a student majoring in Indonesian Literature, in a course, Toni is given
the task of writing a poem by Chairil Anwar. Toni chose a poem entitled
"Krawang-Bekasi". Using Vi Editor Toni writes the verse and saves it with
the file name SYAIR.txt.

“Kami yang kini terbaring antara Krawang-Bekasi


Tidak bisa teriak ‘Merdeka’ dan angkat senjata lagi
Tapi siapakah yang tidak lagi mendengar deru kami
Terbayang kami maju dan mendegap hati?
Kami bicara padamu dalam hening di malam sepi
Jika dada rasa hampa dan jam dinding yang berdetak
Kami mati muda. Yang tinggal tulang diliputi debu.
Kenang, kenanglah kami.

When finished writing the poem and save it. Toni remembered that
the poem had additional verses, so Toni created a new file with the name
Tambahan.txt and then saved it.

Kami sudah coba apa yang kami bisa


Tapi kerja belum selesai, belum bisa memperhitungkan arti 4-5 ribu
nyawa
Kami cuma tulang-tulang berserakan
Tapi adalah kepunyaanmu
Kaulah lagi yang tentukan nilai tulang-tulang berserakan
Atau jiwa kami melayang untuk kemerdekaan, kemenangan dan
harapan”

After finishing writing the poem, Toni put it all together file into a
file named KRAWANGBEKASI.txt.

13
4.2 Network Configuration
4.2.1 Identificationi Ethernet Interface
To be able to identify can be done in the following ways.
a. How to Identify Ethernet Interfaces
To identify available ethernet interfaces, use the command:
[root@sisjarlab sisjar]#ip address

Or:
[root@sisjarlab sisjar]#ip address show

Image 2.11 Ens33 interface display before being given IP address settings

4.2.2 Configuring IP Address Using NMCLI


Some of the commands to use NMCLI are:
a. Add an IP address
[root@sisjarlab sisjar]#ip address add [IP
address/Prefix] dev [Ethernet Interface Name]
Example :
[root@sisjarlab sisjar]#ip address add 10.220.19.1/25
dev ens33

14
Image 2.12 Command to add IP address on ens33 interface

b. Modify the IP address


[root@sisjarlab sisjar]#ip address change [IP
address/Prefix] dev [Ethernet Interface Name]
Example :
[root@sisjarlab sisjar]#ip address change
10.220.19.1/25 dev ens33

Image 2.13 Command to change IP address on ens33 interface

c. Remove the IP address


[root@sisjarlab sisjar]#ip address delete [IP
address/Prefix] dev [Ethernet Interface Name]
Example :
[root@sisjarlab sisjar]#ip address delete
10.220.19.1/25 dev ens33

Image 2.14 Command to delete IP address on ens33 interface

d. Update IP address Configuration


[root@sisjarlab sisjar]#service network restart

Image 2.15 Command update IP address configuration

15
4.2.3 Configuring IP Address Using NMTUI
Here are the steps to configure with NMTUI.
a. Enter the NMTUI command as follows.

Image 2.16 Command NMTUI

b. It appears to look like the following. To edit the IP address, select Edit a
connection by pressing the enter key.

Image 2.17 Select Edit a connection by pressing the Enter key

16
c. Next, an interface appears. To configure Ethernet, select ens33 and use the right
arrow key to select . Press Enter.

Image 2.18 Select <Edit…>

d. The following view will appear. Select IPv4 Configuration and change
<Automatic> to <Manual>.

Image 2.19 IPv4 Configuration settings view

17
Image 2.20 Change IPv4 Configuration to <Manual>

Image 2.21 IPv4 Configuration View

18
e. Next, fill in the IP in the Addresses field, and the DNS server as following
image.

Image 2.22 IPv4 Configuration Settings

f. Select <OK> when you've finished configuring.

Image 2.23 Select <OK>

19
g. To activate a preconfigured interface, select Activate a connection in the main
menu.

Image 2.24 Select <Back>

Image 2.25 Select Active a connection

20
h. Next, there will be a selection of available interfaces. Select the interface
that you want to enable, and point the option to <Activate>. (If the status
already <Deactivate>means the interface is already active)

Image 2.26 Select <Activate> on ens33

Image 2.27 Interface ens33 successfully active

21
i. To check the preconfigured IP address, enter the following command:
[root@sisjarlab sisjar]#ip address show

Image 2.28 Ens33 IP address display

j. Ping to ip 10.220.19.1 and press ctrl+c to stop it. If the display as shown below
then ping is successfull.

Image 2.29 Ping IP Address

22
V. Bibliography
1. Laboratorium Sistem Operasi dan Jaringan Komputer. (2015). Modul Praktikum
Sistem Operasi 2015. Bandung, Laboratorium Sistem Operasi dan Jaringan
Komputer.
2. Laboratorium Sistem Operasi dan Jaringan Komputer. (2016). Modul Praktikum
Sistem Operasi 2016. Bandung, Laboratorium Sistem Operasi dan Jaringan
Komputer.
3. Laboratorium Sistem Operasi dan Jaringan Komputer. (2019). Modul Praktikum
Sistem Operasi 2019. Bandung, Laboratorium Sistem Operasi dan Jaringan
Komputer.
4. Laboratorium Sistem Operasi dan Jaringan Komputer. (2019). Modul Praktikum
Sistem Operasi 2020. Bandung, Laboratorium Sistem Operasi dan Jaringan
Komputer
5. Mallet, A. (2014). CentOS System Administration Essentials. Birmingham: Packt
Publishing Ltd.
6. Smith, Roderick W. (2009). CompTIA Linux+ Study Guide. Indianapolis: Wiley
Publishing, Inc.

23

You might also like