You are on page 1of 13

COMP 83

LINUX 1
Lab 2

Student Name: Dilpreet Singh

Student ID: 4326286

Date: 16/06/2021
Perform the following task using the Linux command-line tool:

a) In the /root directory, create a directory myLab-XXX, where XXX is the


last 3 digits of your student’s ID.

b) In myLab directory create the following files using the vi editor:

fileA.txt fileB.txt fileC.txt

Joe Harvey 76 Edward Jones 90 Joe Mississauga


Bob Miller 45 Tom Arnold 25 Bob Ajax
Sally Shield 81 Mark Hill 61 Sally Brampton
Courtney Adam 56 Sharon Price 44 Courtney
Scarborough
c) Display the content of fileA.txt, fileB.txt, and fileC.txt
d) Display the top 2 rows of fileA.txt
e) Display the bottom 3 lines of fileA.txt

f) Combine fileA.txt and fileB.txt (one on top of the other)


g) Merge fileA.txt with fileB.txt (side by side)

h) Join fileA.txt and fileB.txt


i) Join fileA.txt and fileC.txt

j) Sort the first column of fileA.txt in alphabetical order


k) Sort the first column of fileA.txt in reverse alphabetical order

l) Sort the second column of fileA.txt in alphabetical order


m) Sort the second column of fileA.txt in reverse alphabetical order

n) Sort the third column of fileA.txt in ascending order (lowest number first)
o) Sort the third column of fileA.txt in descending order (highest number
first)

p) Add numbered lines to fileB.txt


q) Perform a word count on fileB.txt

r) Change Ajax to Hamilton in fileC.txt


Marking Rubrics
No submission 0/10
Complete or incomplete submission after 3/10
cut off time
Complete less than 80% of task before cut 5/10
off time
Complete less than 80% of task within time 6/10
limit
Complete at least 80% of task before cut off 7/10
time
Complete at least 80% of tasks within time 8/10
limit
Complete all tasks before the cut off limit 9/10
Complete all tasks within time limit 10/10

Mark:__________
END

You might also like