Sie sind auf Seite 1von 32

Module Code & Module Title

CS5001NA Networks and Operating System

Assessment Weightage & Type

10% Individual Coursework

Year and Semester

2018-19 Autumn

Student Name: Pujan Magar

London Met ID: 17030795

College ID: NP01NT4A170067

Assignment Due Date: 4th Feb, 2019

Assignment Submission Date: 4th Feb, 2019

Word Count : 3048

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 marks of zero will be awarded.
Contents
INTRODUCTION ............................................................................................................................ 1
TRANSCRIPT ................................................................................................................................. 2
CONCLUSION.............................................................................................................................. 29
Bibliography............................................................................................................................... 30
CS5001NI Networks And Operating Systems

INTRODUCTION
The main objectives of this course work are as follows:

 To introduce students some relevant UNIX interface details by practicing


UNIX commands.
 To perform some simple file-based operation by putting commands step by
step.
 To provide student knowledge about Linux Operating System, UNIX and Bash
Scripting

Introduction to Linux

Linux is an Operating System just like Windows OS of Microsoft, Mac OS of Apple.


Linux Operating System kernel first released on September 17, 1991, by Linus
Torvalds Linux contains Bootloader, Kernel, Daemons, Shell, Graphical Server,
Desktop Environment, Applications but Linux mainly is operated with Command user
interfaces rather than Graphical user interfaces. There are various types of Linux
distributions also known by distros like; Ubuntu, Debian (Kali Linux), Linux Mint, Arch
Linux, Fedora, openSUSE, Red Hat, Parrot, etc (Xiao, Zheng, & Wang, 2016).

1
Pujan Magar
CS5001NI Networks And Operating Systems

TRANSCRIPT

Script started on Sun Jan 25 21:10:05 2019

#Task 1

pujanmagar@HRAP:~$ PS1='$PWD> '

This command sets the prompt to display the pathname of the working directory as
home directory

$ /home/pujanmagar>mkdir –p WorldCup/{Argentina,France,Germany,Brazil,Japan}

Makes a parent directory as WorldCup and child directories as


Home,Argentina,France,Germany,Brazil and Japan

/home/pujanmagar>ls WorldCup

Argentina Brazil France Germany Japan

Displays the lists of unhidden files and folders of WorldCup directory

TOTAL MARKD AWARDED FOR TASK 1:

#Task 2

$ /home/pujanmagar/ > cd WorldCup/Argentina/

Changing to Argentina directory from WorldCup directory

$ /home/pujanmagar/WorldCup/Argentina> pwd

Displays the current working directory as Argentina as shown below

/home/pujanmagar/WorldCup/Argentina

$ /home/pujanmagar/WorldCup/Argentina> touch file1 file2 file3

Creates three files inside Argentina directory as file1, file2 and file3 by using
touch“utility

2
Pujan Magar
CS5001NI Networks And Operating Systems

TOTAL MARKD AWARDED FOR TASK 2:

#Task 3

/home/pujanmagar/WorldCup/Argentina> cd ..

Changes to the WordlCup directory as shown below

/home/pujanmagar/WorldCup>

/home/pujanmagar/WorldCup/Argentina> rm –i Argentina/file1 Argentina/file2


Argentina/file3

Removes the files file1, file2 and file3 from the Argentina Directory with interactive
mode prompting a message to be removed or not as shown below

rm: remove regular empty file 'file1'? y

rm: remove regular empty file 'file2'? y

rm: remove regular empty file 'file3'? y

/home/pujanmagar/WorldCup> rmdir Argentina/

It removes the Argentina directory from the WorldCup directory

/home/pujanmagar/WorldCup> ls -R

Shows the absence of Argentina Directory as well as files within it as shown below

Brazil France Germany Japan

./Brazil:

./France:

./Germany:

3
Pujan Magar
CS5001NI Networks And Operating Systems

./Japan:

OR

/home/pujanmagar/WorldCup> ls

Brazil France Germany Japan

TOTAL MARKD AWARDED FOR TASK 3:

#Task 4

/home/pujanmagar/WorldCup> echo -e "Hello! I am proud to be part of


Islingtonians.\n14 < (2+2)"

Prints out the desired letters and numbers (alphanumericals) and symbols written
within the quotation mark using echo utility as shown below

Hello! I am proud to be part of Islingtonians.

14 < (2+2)

/home/pujanmagar/WorldCup> pwd

To display and verify that the current working directory is WorldCup as shown below

/home/pujanmagar/WorldCup

/home/pujanmagar/WorldCup> cd Japan/

Changes to the Japan directory

/home/pujanmagar/WorldCup/Japan> pwd

Displays and verifies that the current working directory is Japan

/home/pujanmagar/WorldCup/Japan

/home/pujanmagar/WorldCup/Japan>

TOTAL MARKD AWARDED FOR TASK 4:

4
Pujan Magar
CS5001NI Networks And Operating Systems

#Task 5

/home/pujanmagar/WorldCup/Japan> pwd; cd; pwd

At first “pwd;” command shows the current working directory as Japan, “cd;”
command takes to the home directory to “pujanmagar” and “pwd;” command shows
the current working directory as home directory “pujanmagar”

/home/pujanmagar/WorldCup/Japan

/home/pujanmagar

/home/pujanmagar>

TOTAL MARKD AWARDED FOR TASK 5:

#Task 6

/home/pujanmagar/WorldCup/Japan> pwd; cd ..; pwd; cd ..; pwd

pwd; :displays the current working directory as Japan

cd ..; :takes one step back from the current working directory to WorldCup

pwd; :verifies the current working directory as WorldCup

cd ..:takes one step back to home directory as pujanmagar

pwd :verifies that the current directory is pujanmagar

results are shown below

/home/pujanmagar/WorldCup/Japan

/home/pujanmagar/WorldCup

/home/pujanmagar

/home/pujanmagar>

TOTAL MARKD AWARDED FOR TASK 6:

#Task 7

/home/pujanmagar> cd; pwd

Remains at the same directory as it is already in home directory

/home/pujanmagar

/home/pujanmagar> ls

5
Pujan Magar
CS5001NI Networks And Operating Systems

Lists out only the unhidden items present within the selected directory

/home/pujanmagar> ls –a

Lists out unhidden as well as hidden items present within the selected directory

/home/pujanmagar> ls -al

Lists out the hidden and unhidden items present within the selected directory alonf
with their permission properties to the users, groups and others about access level of
data manipulation

TOTAL MARKD AWARDED FOR TASK 7:

#Task 8

/home/pujanmagar> cd; pwd; cd cw2; pwd

Command “cd;” takes to the home directory

Command “pwd;” shows current working directory

Command “cd cw2” tends to take into cw2 directory. But there is no such directory.
So, error message is thrown

/home/pujanmagar

bash: cd: cw2: No such file or directory

/home/pujanmagar

/home/pujanmagar> ls -R

lists out all the recursive tree of parent as well as child folders and files as shown
below

17030795cw2 WorldCup

./WorldCup:

Brazil France Germany Japan

./WorldCup/Brazil:

6
Pujan Magar
CS5001NI Networks And Operating Systems

./WorldCup/France:

./WorldCup/Germany:

./WorldCup/Japan:

/home/pujanmagar>

TOTAL MARKD AWARDED FOR TASK 8:

#Task 9

Creating three separate files using the “cat >” command utility

/home/pujanmagar/WorldCup/France> cat >testX

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

/home/pujanmagar/WorldCup/France> cat > testY

aaabb Aaaaa AAAAA

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

7
Pujan Magar
CS5001NI Networks And Operating Systems

/home/pujanmagar/WorldCup/France> cat >testZ

aaabb Aaaaa AAAAA

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

TOTAL MARKD AWARDED FOR TASK 9:

#Task 10

Displaying three separate files using the “cat” command utility

/home/pujanmagar/WorldCup/France> cat testX

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

/home/pujanmagar/WorldCup/France> cat testY

aaabb Aaaaa AAAAA

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

/home/pujanmagar/WorldCup/France> cat testZ

aaabb Aaaaa AAAAA

8
Pujan Magar
CS5001NI Networks And Operating Systems

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

TOTAL MARKD AWARDED FOR TASK 10:

#Task 11

Copying all three files of France to Brazil directory

/home/pujanmagar/WorldCup/France> cp testX testY testZ ../Brazil/

TOTAL MARKD AWARDED FOR TASK 11:

#Task 12

Concatenating three files at once

/home/pujanmagar/WorldCup/France> cat testX testY testZ

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff–ff Ccccc

CCCCC

cccdd Ddddd

9
Pujan Magar
CS5001NI Networks And Operating Systems

DDDD

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff–ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

Giving input of concatenated values to the new file as “testResult”

/home/pujanmagar/WorldCup/France> cat testX testY testZ > testResult

/home/pujanmagar/WorldCup/France> cat testX - testY >> testResult

This is a Beta testing phase of linux

All the commands are typed with precision

/home/pujanmagar/WorldCup/France> cat testResult

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

aaabb Aaaaa

10
Pujan Magar
CS5001NI Networks And Operating Systems

AAAAA

bbbcc Bbbbb

BBBBB

ff–ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff–ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

This is a Beta testing phase of linux

All the commands are typed with precision

11
Pujan Magar
CS5001NI Networks And Operating Systems

TOTAL MARKD AWARDED FOR TASK 12:

#Task 13

/home/pujanmagar/WorldCup/France> cat test[XYZ]

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

aaabb Aaaaa AAAAA

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

aaabb Aaaaa AAAAA

bbbcc Bbbbb BBBBB

ff–ff Ccccc CCCCC

cccdd Ddddd DDDDD

cat test[XYZ] displays all the contents of three files having “test” as common at once.

TOTAL MARKD AWARDED FOR TASK 13:

#Task 14

To display access permission for all files of France

/home/pujanmagar/WorldCup/France> ls -l

12
Pujan Magar
CS5001NI Networks And Operating Systems

total 0

-rw-rw-rw- 1 pujanmagar pujanmagar 406 Jan 25 21:45 testResult

-rw-rw-rw- 1 pujanmagar pujanmagar 72 Jan 25 21:45 testX

-rw-rw-rw- 1 pujanmagar pujanmagar 93 Jan 25 21:45 testY

-rw-rw-rw- 1 pujanmagar pujanmagar 87 Jan 25 21:45 testZ

Removing all access permission for testX file

/home/pujanmagar/WorldCup/France> chmod -777 testX

Access permission removed for testX file as shown below

/home/pujanmagar/WorldCup/France> ls -l testX

---------- 1 pujanmagar pujanmagar 72 Jan 25 21:47 testX

Trying to read testX file

/home/pujanmagar/WorldCup/France> nano testX

[ Error reading testX: Permission denied ]

Trying to write into testX file

/home/pujanmagar/WorldCup/France> cat > testX

bash: testX: Permission denied

Adding read and write permission for current user “pujanmagar”

/home/pujanmagar/WorldCup/France> chmod u+rw testX

Listing out the access permission of testX file after adding the read and write
permissions

/home/pujanmagar/WorldCup/France> ls -l testX

13
Pujan Magar
CS5001NI Networks And Operating Systems

-rw------- 1 pujanmagar pujanmagar 72 Jan 25 21:54 testX

Trying to read testX file

/home/pujanmagar/WorldCup/France> cat testX

aaabb Aaaaa

AAAAA

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

Trying to write into testX file

/home/pujanmagar/WorldCup/France> nano testX

TOTAL MARKD AWARDED FOR TASK 14:

#Task 15

Changing to France directory

/home/pujanmagar/WorldCup/France> cd ..

Displaying access permission for France

/home/pujanmagar/WorldCup> ls -ld France/

drwxr-xr-x 1 pujanmagar pujanmagar 4096 Jan 25 21:55 France/

Removing access permission for France directory

/home/pujanmagar/WorldCup> chmod -777 France/

14
Pujan Magar
CS5001NI Networks And Operating Systems

Displaying access permission for France Directory

/home/pujanmagar/WorldCup> ls -ld France/

d--------- 1 pujanmagar pujanmagar 4096 Jan 25 21:58 France/

Trying to Read testY file from France using cat utility

/home/pujanmagar/WorldCup> cat France/testY

cat: France/testY: Permission denied

trying to put testX file into France

/home/pujanmagar/WorldCup> cp Brazil/testX France/

cp: cannot stat 'France/testX': Permission denied

Trying to list out the contents of France directory

/home/pujanmagar/WorldCup> ls France/

ls: cannot open directory 'France/': Permission denied

Adding Read, write and execute permission for France

/home/pujanmagar/WorldCup> chmod u+rwx France/

Displaying the access permission for France

/home/pujanmagar/WorldCup> ls -ld France/

drwx------ 1 pujanmagar pujanmagar 4096 Jan 25 22:01 France/

Trying to read testX file from France

/home/pujanmagar/WorldCup> cat France/testX

aaabb Aaaaa

AAAAA

15
Pujan Magar
CS5001NI Networks And Operating Systems

bbbcc Bbbbb

BBBBB

ff-ff Ccccc

CCCCC

cccdd Ddddd

DDDDD

Trying to put a file named “GenerationZ” into France directory

/home/pujanmagar/WorldCup> touch France/GenerationZ

Searching the newly added file into France directory

/home/pujanmagar/WorldCup> ls France/

GenerationZ testResult testX testY testZ

TOTAL MARKD AWARDED FOR TASK 15:

#Task 16

Grep command

/home/pujanmagar/WorldCup/Brazil> grep bb testX

aaabb Aaaaa

bbbcc Bbbbb

It displays the contents having the “bb” up to the last line counts

/home/pujanmagar/WorldCup/Brazil> grep -v bb testX

AAAAA

BBBBB

ff-ff Ccccc

CCCCC

16
Pujan Magar
CS5001NI Networks And Operating Systems

cccdd Ddddd

DDDDD

It displays all the contents excluding the word containing “bb”

/home/pujanmagar/WorldCup/Brazil> grep -n bb testX

1:aaabb Aaaaa

3:bbbcc Bbbbb

It displays the word lines containing “bb” along with their line numbers

/home/pujanmagar/WorldCup/Brazil> grep -l bb *

testX

testY

testZ

It displays all the files with “bb” contained within their lines

/home/pujanmagar/WorldCup/Brazil> grep -i bb *

testX:aaabb Aaaaa

testX:bbbcc Bbbbb

testX:BBBBB

testY:aaabb Aaaaa AAAAA

testY:bbbcc Bbbbb BBBBB

testZ:aaabb Aaaaa AAAAA

testZ:bbbcc Bbbbb BBBBB

It displays the contents of all files with “bb” included in their lines either containing
alphabet “b” or “B”

17
Pujan Magar
CS5001NI Networks And Operating Systems

/home/pujanmagar/WorldCup/Brazil> grep -i BB *

testX:aaabb Aaaaa

testX:bbbcc Bbbbb

testX:BBBBB

testY:aaabb Aaaaa AAAAA

testY:bbbcc Bbbbb BBBBB

testZ:aaabb Aaaaa AAAAA

testZ:bbbcc Bbbbb BBBBB

It also displays the contents of all files with “BB” included in their lines either
containing alphabet “B” or “b”

/home/pujanmagar/WorldCup/Brazil> grep -c bb *

testX:2

testY:2

testZ:2

It displays the total line counts containing “bb” of all the files

/home/pujanmagar/WorldCup/Brazil> grep '^A' *

testX:AAAAA

It displays the content including “A” of only the testX file

/home/pujanmagar/WorldCup/Brazil> grep -n '^' testX

1:aaabb Aaaaa

2:AAAAA

3:bbbcc Bbbbb

4:BBBBB

5:ff-ff Ccccc

18
Pujan Magar
CS5001NI Networks And Operating Systems

6:CCCCC

7:cccdd Ddddd

8:DDDDD

It displays all the contents with the respective line counts of testX

TOTAL MARKD AWARDED FOR TASK 16:

#Task 17

Using alias command to create a custom shortcut used for representing a command.
~/.bashrc is used in order to permanently store these alias. So that it could be used
in another terminal sessions further.

/home/pujanmagar> cd WorldCup/Brazil/

/home/pujanmagar/WorldCup/Brazil> alias lsR="ls -R"

/home/pujanmagar/WorldCup/Brazil> alias lsl="ls -l"

/home/pujanmagar/WorldCup/Brazil> type lsR

lsR is aliased to `ls -R'

/home/pujanmagar/WorldCup/Brazil> type lsR

lsR is aliased to `ls -R'

/home/pujanmagar> lsR.:

17030795cw2 WorldCup

./WorldCup:

Brazil France Germany Home Japan

./WorldCup/Brazil:

testX testY testZ

19
Pujan Magar
CS5001NI Networks And Operating Systems

./WorldCup/France:

GenerationZ testResult testX testY testZ

./WorldCup/Germany:

./WorldCup/Home:

./WorldCup/Japan:

/home/pujanmagar> lsl

total 48

-rw-r--r-- 1 pujanmagar pujanmagar 47620 Jan 25 22:05 17030795cw2

drwxr-xr-x 1 pujanmagar pujanmagar 4096 Jan 25 22:05 WorldCup

TOTAL MARKD AWARDED FOR TASK 17:

#Task 18

Removing the aliased shortcuts created on task17

/home/pujanmagar> unalias lsR

/home/pujanmagar> unalias lsl

/home/pujanmagar> lsR

bash: lsR: command not found

/home/pujanmagar> lsl

bash: lsl: command not found

The aliased shortcuts are removed from the system and could not be used anymore

TOTAL MARKD AWARDED FOR TASK 18:

20
Pujan Magar
CS5001NI Networks And Operating Systems

#Task 19

TOTAL MARKD AWARDED FOR TASK 19:

/home/pujanmagar>touch .environmentalfile

/home/pujanmagar>nano .environmentalfile

/home/pujanmagar>touch .bashrc

/home/pujanmagar> .bashrc

Making a file named .environmentalfile and editing it. Making another file as .bashrc

/home/pujanmagar>exit

exit

Script done on Fri Jan 25 22:36:03 2019

Script started on Fri Jan 25 22:40:34 2019

pujanmagar@HRAP:~$ PS1='$PWD>'

#Task 20

/home/pujanmagar>alias noAllf=”ls –a | wc -l”

/home/pujanmagar>nano .environmentalfile

TOTAL MARKD AWARDED FOR TASK 20:

/home/pujanmagar>alias noAsubsir=”ls –aR | wc -l”

/home/pujanmagar>nano .environmentalfile

#Task 21

/home/pujanmagar>alias nAcs=”ls –a | grep ^[gtw] | wc -l ”

/ home/pujanmagar>nano .environmentalfile

home/pujanmagar> .bashrc

21
Pujan Magar
CS5001NI Networks And Operating Systems

pujanmagar@HRAP: ~$PS1=”$PWD> ”

/home/pujanmagar>alias

TOTAL MARKD AWARDED FOR TASK 21:

#Task 22

/home/pujanmagar>alias nAcs=”ls –a | grep ^[gtw] | wc -l ”

/ home/pujanmagar>nano .environmentalfile

home/pujanmagar> .bashrc

TOTAL MARKD AWARDED FOR TASK 22:

#Task 23

/home/pujanmagar>noAllf

TOTAL MARKD AWARDED FOR TASK 23:

#Task 24

/home/pujanmagar>noAsubsir

TOTAL MARKD AWARDED FOR TASK 24:

#Task 25

/home/pujanmagar>noAcs

TOTAL MARKD AWARDED FOR TASK 25:

#Task 26

pujanmagar@HRAP:~$ history

1 history

2 clear

22
Pujan Magar
CS5001NI Networks And Operating Systems

3 rm .bash_history

4 PS1='$PWD>'

5 mkdir -p WorldCup/{Argentina,France,Germany,Brazil,Japan}

6 ls WorldCup

7 cd WorldCup/Argentina

8 pwd

9 touch file1 file2 file3

10 cd ..

11 rm -i Argentina/file1 Argentina/file2 Argentina/file3

12 ls Argentina/

13 cat Argentina/file1

14 cat Argentina/file2

15 cat Argentina/file3

16 rm -i -r Argentina

17 ls Argentina

18 ls

19 echo -e "Hello! I am proud to be part of Islingtonians.\n14<(2+2)"

20 pwd

21 cd Japan

22 pwd

23 pwd;cd;pwd

24 echo –e

"The starting command pwd displays the current working directory in which we are
working in. The command cd takes Japan directory to home directory and at last the
command pwd displays the current working directory as home directory."

25 cd WorldCup/Japan

26 pwd;cd ..;pwd;cd ..;pwd

23
Pujan Magar
CS5001NI Networks And Operating Systems

27 echo -e "The starting command pwd shows the current working directory, the
command cd .. takes Japan directory to WorldCup directory then again pwd
command shows the current working directory after that cd .. takes WorldCup
directory to home directory and at last pwd shows the current working directory as
home directory."

28 cd;pwd

29 echo -e "The command cd takes directory to home directory and pwd


command shows the current working directory."

30 ls

31 echo -e "The command ls displays all the file and folders 0f the home
directory."

32 ls -a

33 echo -e "The command ls -a displays all the files and folders including the
hidden files and folders of the current working directory."

34 ls -al

35 echo -e "The command ls -al displays the details of all the files and folders with
the formal list. Access permission is also displayed with other information like date
created, time, size etc."

36 cd;pwd;cd cw2;pwd

37 echo -e "The command cd takes working directory to home directory, the


command pwd displays the current working directory as home directory, the
command cd cw2 tries to change the directory to cw2 directory but its shows error
message as cw2 isn't created, at last pwd command which shows the current
working directory."

38 ls -R

39 echo -e "The command ls -R displays all the directories and sub-directories


including all the existing directories, sub-directories and file which is contained inside
directory."

40 cd WorldCup/France

41 cat>testX

42 cat>testY

43 cat>testZ

44 cat testX

24
Pujan Magar
CS5001NI Networks And Operating Systems

45 cat testY

46 cat testZ

47 cp testX testY testZ ../Brazil

48 cat testX testY testZ

49 cat testX testZ>testResult

50 cat testX - testY>> testResult

51 cat testResult

52 cat test[XYZ]

53 echo -e "The command cat test[XYZ] concatentes the contest of testX testY
testZ."

54 ls -al

55 chmod -rwx testX

56 ls -al testX

57 cat testX

58 cat>testX

59 chmod u+rw testX

60 ls -al testX

61 cat testX

62 cat>testX

63 cd ..

64 ls -ld France

65 chmod -rwx France

66 ls -ld France

67 cat France/testX

68 cat>France/newfile

69 ls -R France

70 chmod u+rwx France

25
Pujan Magar
CS5001NI Networks And Operating Systems

71 ls -ld France

72 cat France/testX

73 cat>France/newfile1

74 ls France

75 cd Brazil

76 grep bb testX

77 echo -e "The command grep bb testX displays the line containing bb."

78 grep -v bb testX

79 echo -e "This command grep -v bb testX displays the line which do not contain
bb."

80 grep -n bb testX

81 echo -e "grep -n bb testX command is used to display each matching line with
its line number."

82 grep -l bb *

83 echo "The command grep -l bb * display the line that contain bb from all the
files of the current directory as Brazil directory."

84 grep -i bb *

85 echo -e "The command grep -i bb * is used to displays the line which contain
bb along with its filename and it is not case sensitive."

86 grep -i BB *

87 echo -e "The command grep -i BB is used to search all the file in current
directory which contains the text BB and displays the matching line contains bb and
BB."

88 grep -c bb *

89 echo -e "The command grep -c bb * counts the number of bb from testX testY
and testZ and display the number with file name in front of it."

90 grep '^A' *

91 echo -e "The command grep '^A'^ is used to search all the data starting with
capital A in the file of current directory as Brazil and displays the line starts with
capital A from each file."

26
Pujan Magar
CS5001NI Networks And Operating Systems

92 grep -n '^' testX

93 echo -e "The command grep -n '^' testX displays the line number of testX file of
current directory."

94 cd

95 alias lsR="ls -R"

96 alias lsl="ls -l"

97 alias

98 lsR

99 lsl

100 unalias lsR

101 unalias lsl

102 lsR

103 lsl

104 nano .bashrc

105 exit

106 script 17030795cw2

107 PS1='$PWD>'

108 lsl

109 lsR

110 nano .bashrc

111 exit

112 script -a 17030795cw2

113 PS1='$PWD>'

114 noAllf

115 noAsubsir

116 . .bashrc

117 noAcs

27
Pujan Magar
CS5001NI Networks And Operating Systems

118 history

TOTAL MARKD AWARDED FOR TASK 26:

#Task 27

pujanmagar@HRAP:~$ !7

cd WorldCup/Argentina

bash: cd: WorldCup/Argentina: No such file or directory

TOTAL MARKD AWARDED FOR TASK 27:

#Task 28

pujanmagar@HRAP:~$ !c

cd WorldCup/Argentina

bash: cd: WorldCup/Argentina: No such file or directory

pujanmagar@HRAP:~$ exit

exit

TOTAL MARKD AWARDED FOR TASK 28:

Script done on Fri Jan 25 22:35:22 2019

28
Pujan Magar
CS5001NI Networks And Operating Systems

CONCLUSION
The tasks (i.e. 1-28) are completed successfully and are recorded in the script file
named 17030795cw2. In addition, the junk file containing the error commands is also
cleaned before finalizing the report. This report took a lot of effort as this was
unfamiliar Operating System. But the commands were practiced for many times for
ease. And finally it was completed by starting the script file, entering the suitable
commands and ending the script.

29
Pujan Magar
CS5001NI Networks And Operating Systems

Bibliography
Xiao, G., Zheng, Z., & Wang, H. (2016, September 27). Evolution of Linux operating system network.
Physica A, 249-258. Retrieved January 14, 2019, from https://ac.els-
cdn.com/S0378437116306379/1-s2.0-S0378437116306379-main.pdf?_tid=beedfa94-4db7-
44ae-ac6a-512a68e2901c&acdnat=1549208537_fad52584455f3369e4515dc366afe83b

30
Pujan Magar

Das könnte Ihnen auch gefallen