You are on page 1of 16

Module Code & Module Title

Level 5 – Network Operating Systems

Assessment Type
Logbook 1

Semester
2022 Spring/Autumn

Student Name: Smriti Swar


London Met ID: 210259
College ID: np01cp4a210259
Assignment Due Date: 12 November 2022

Assignment Submission Date: 12 November 2022

Submitted To: Mr.Pratk Karki


Word Count (Where Required):

I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline in order for my assignment to be accepted and marked. I am
fully aware that late submissions will be treated as non-submission and a mark of zero will be awarded
List of Contents
Introduction: .................................................................................................................... 1

Aims and Objectives:....................................................................................................... 1

Using the script command ............................................................................................... 1

Using the whoami command ........................................................................................... 2

Using the who command: ................................................................................................ 2

Using the finger command .............................................................................................. 3

Using the date command ................................................................................................ 3

Using the different types of listing files commands .......................................................... 4

Using the /etc/passwd command: ................................................................................... 5

Creating a new one-line file ............................................................................................. 6

Creating a new multiline file ............................................................................................ 7

Combining two files ......................................................................................................... 7

Checking the contents of the file ..................................................................................... 7

Closing the script ............................................................................................................. 8

Conclusion: ..................................................................................................................... 8
List of Figures
Figure 1: Using the script command ................................................................................ 2
Figure 2: Using the whoami command in terminal .......................................................... 2
Figure 3: Using the who command in the linux ................................................................ 3
Figure 4: Using the finger command in the terminal ........................................................ 3
Figure 5: Using the date function in the terminal ............................................................. 4
Figure 6: Listing the files using ls command .................................................................... 4
Figure 7:Listing all the files along with the hidden files .................................................... 4
Figure 8: Lists all the files and directories along with hidden files with extra information 5
Figure 9: Using the /etc/passwd command in the terminal .............................................. 6
Figure 10: Creating a new file ......................................................................................... 6
Figure 11: Creating a multi-line file .................................................................................. 7
Figure 12: Checking the contents of file1 ........................................................................ 7
Figure 13:Checking the contents of test2 file .................................................................. 8
Figure 14: Saving and ending the script .......................................................................... 8
Network Operating System CT505NI

Introduction:
When operating Linux, you need to use a shell – a program that gives you access
to the operating system’s services. Most Linux distributions use a graphical user
interface (GUI), making them beginner-friendly. When operating Linux, you need to
use a shell – a program that gives you access to the operating system’s services.
Most Linux distributions use a graphical user interface (GUI), making them
beginner-friendly.
However, utilizing the command-line interface (CLI) because it’s quicker and offers
more control. Tasks that require multiple steps on the GUI can be done in a matter
of seconds by entering commands into the CLI

Aims and Objectives:


The main aims and objectives of this logbook are:

1. To know about various Linux commands.


2. To know the differences between a file, folder and directories.
3. To use the terminal for Linux.
4. To know about services and use the services provided by the Linux operationg
system.

Using the script command


Type script tutorial6 at the prompt. The word after script is the name of the folder in which
all of your record or typescript of terminal activities will be stored. After executing the script
command it will start to record everything that is typed on the screen including the input
and output until exit.

1
Smriti Swar
Network Operating System CT505NI

Figure 1: Using the script command

Using the whoami command


Type whoami to see your username. The whoami command enables us to
see the currently-logged in user.

Figure 2: Using the whoami command in terminal

Using the who command:


The who command in Linxu enables you to display the number of current user logged in
to the Linux/UNIX operating system. A user can use the who command when he/she

2
Smriti Swar
Network Operating System CT505NI

wants to know the number of users currently logged onto the system and the information
about them.

Figure 3: Using the who command in the linux

Using the finger command


The finger command is used to obtain all the available information about the system’s
user.

Figure 4: Using the finger command in the terminal

Using the date command


The date command in Linux is used to display the current date and time of the system.

3
Smriti Swar
Network Operating System CT505NI

Figure 5: Using the date function in the terminal

Using the different types of listing files commands


• ls command: the ls command is used to list files and directories in the Linux and
other UNIX based-operating system.

Figure 6: Listing the files using ls command

• ls -a commad: This command list all the available files along with the hidden files
in the operating system. Hidden files are those files that have ‘.’ in front of their
name.

Figure 7:Listing all the files along with the hidden files

4
Smriti Swar
Network Operating System CT505NI

• ls -a -l command: command to list files or directories in a table format with extra

information including hidden files or directories.

Figure 8: Lists all the files and directories along with hidden files with extra information

The differences between the ls, ls -a and the ls -a -l command is that ls command only
lists the files and directories available in the operating system wheareas the ls -a
command shows the available files along with the hidden files and the ls -a -l command
shows all the files with extra information.

Using the /etc/passwd command:


The etc/passwd command is used along with cat. It is a text file that contains one entry
per line representing the user account. Usually the first line represents the root user,
followed by the system and the normal users.

5
Smriti Swar
Network Operating System CT505NI

Figure 9: Using the /etc/passwd command in the terminal

Creating a new one-line file

Figure 10: Creating a new file

6
Smriti Swar
Network Operating System CT505NI

Creating a new multiline file

Figure 11: Creating a multi-line file

Combining two files

Checking the contents of the file

Figure 12: Checking the contents of file1

7
Smriti Swar
Network Operating System CT505NI

Figure 13:Checking the contents of test2 file

Closing the script

Figure 14: Saving and ending the script

Conclusion:
The main aim of this logbook was to teach us the different commands used in the linux
operating system, and we definitely learned about the various basic commands of the
Linux regarding the file system. It helped us to apply the theoretical knowledge practically.
The aims and objectives mentioned earlier were fulfilled as we reached the end of our
workshop task.

8
Smriti Swar
Network Operating System CT505NI

Appendix
smriti@LAPTOP-KNRVKTHE:~$ cat tutorial6

Script started on 2022-11-30 15:47:45+05:45 [TERM="xterm-256color" TTY="/dev/tty1"


COLUMNS="120" LINES="30"]

smriti@LAPTOP-KNRVKTHE:~$ whoami

smriti

smriti@LAPTOP-KNRVKTHE:~$ who

smriti@LAPTOP-KNRVKTHE:~$ finger smriti

Login: smriti Name:

Directory: /home/smriti Shell: /bin/bash

Never logged in.

No mail.

No Plan.

smriti@LAPTOP-KNRVKTHE:~$ date

Wed Nov 30 16:28:53 +0545 2022

smriti@LAPTOP-KNRVKTHE:~$ ls

A1script tutorial6

smriti@LAPTOP-KNRVKTHE:~$ ls -a

. .. .bash_history .bash_logout .bashrc .motd_shown .profile


.sudo_as_admin_successful A1script tutorial6

smriti@LAPTOP-KNRVKTHE:~$ ls -a -l

total 12

drwxr-xr-x 1 smriti smriti 4096 Nov 30 15:47 .

9
Smriti Swar
Network Operating System CT505NI

drwxr-xr-x 1 root root 4096 Nov 23 11:05 ..

-rw------- 1 smriti smriti 600 Nov 30 14:51 .bash_history

-rw-r--r-- 1 smriti smriti 220 Nov 23 11:05 .bash_logout

-rw-r--r-- 1 smriti smriti 3771 Nov 23 11:05 .bashrc

-rw-r--r-- 1 smriti smriti 0 Nov 30 10:48 .motd_shown

-rw-r--r-- 1 smriti smriti 807 Nov 23 11:05 .profile

-rw-r--r-- 1 smriti smriti 0 Nov 28 09:57 .sudo_as_admin_successful

-rw-r--r-- 1 smriti smriti 0 Nov 30 14:50 A1script

-rw-r--r-- 1 smriti smriti 0 Nov 30 15:47 tutorial6

smriti@LAPTOP-KNRVKTHE:~$ cat /etc/passwd

root:x:0:0:root:/root:/bin/bash

daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin

bin:x:2:2:bin:/bin:/usr/sbin/nologin

sys:x:3:3:sys:/dev:/usr/sbin/nologin

sync:x:4:65534:sync:/bin:/bin/sync

games:x:5:60:games:/usr/games:/usr/sbin/nologin

man:x:6:12:man:/var/cache/man:/usr/sbin/nologin

lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin

mail:x:8:8:mail:/var/mail:/usr/sbin/nologin

news:x:9:9:news:/var/spool/news:/usr/sbin/nologin

uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin

proxy:x:13:13:proxy:/bin:/usr/sbin/nologin

www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin

10
Smriti Swar
Network Operating System CT505NI

backup:x:34:34:backup:/var/backups:/usr/sbin/nologin

list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin

irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin

gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin

nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin

systemd-network:x:100:102:systemd Network
Management,,,:/run/systemd:/usr/sbin/nologin

systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin

systemd-timesync:x:102:104:systemd Time
Synchronization,,,:/run/systemd:/usr/sbin/nologin

messagebus:x:103:106::/nonexistent:/usr/sbin/nologin

syslog:x:104:110::/home/syslog:/usr/sbin/nologin

_apt:x:105:65534::/nonexistent:/usr/sbin/nologin

tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false

uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin

tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin

sshd:x:109:65534::/run/sshd:/usr/sbin/nologin

landscape:x:110:115::/var/lib/landscape:/usr/sbin/nologin

pollinate:x:111:1::/var/cache/pollinate:/bin/false

smriti:x:1000:1000:,,,:/home/smriti:/bin/bash

smriti@LAPTOP-KNRVKTHE:~$ echo "This is a one-line text file" > file1

smriti@LAPTOP-KNRVKTHE:~$ cat > test2

this is a two line text file

11
Smriti Swar
Network Operating System CT505NI

it has several lines

it has three lines in fact

smriti@LAPTOP-KNRVKTHE:~$ exit

Script done on 2022-11-30 17:52:15+05:45 [COMMAND_EXIT_CODE="0"]

Script started on 2022-12-02 10:53:02+05:45 [TERM="xterm-256color" TTY="/dev/tty3"


COLUMNS="120" LINES="30"]

smriti@LAPTOP-KNRVKTHE:~$ ls

A1script file1 test2 tutorial6

smriti@LAPTOP-KNRVKTHE:~$ cat file1

This is a one-line text file

smriti@LAPTOP-KNRVKTHE:~$ cat test2

this is a two line text file

it has several lines

it has three lines in fact

smriti@LAPTOP-KNRVKTHE:~$ cat file1 test2 > test3

smriti@LAPTOP-KNRVKTHE:~$ ls

A1script file1 test2 test3 tutorial6

smriti@LAPTOP-KNRVKTHE:~$ exit

Script done on 2022-12-02 10:59:21+05:45 [COMMAND_EXIT_CODE="0"]

Script started on 2022-12-02 18:53:12+05:45 [TERM="xterm-256color" TTY="/dev/tty1"


COLUMNS="120" LINES="30"]

12
Smriti Swar
Network Operating System CT505NI

smriti@LAPTOP-KNRVKTHE:~$ cat file1

This is a one-line text file

smriti@LAPTOP-KNRVKTHE:~$ cat test2

this is a two line text file

it has several lines

it has three lines in fact

smriti@LAPTOP-KNRVKTHE:~$ exit

Script done on 2022-12-02 18:54:34+05:45 [COMMAND_EXIT_CODE="0"]

smriti@LAPTOP-KNRVKTHE:~$

13
Smriti Swar

You might also like