0% found this document useful (0 votes)
31 views

Handout Lab1 Assignment

The document describes a Linux lab assignment that involves using various Linux commands like scp, mv, ls, chmod, vi/vim, mkdir, find, sort, pipe, concatenate and compress. Students are instructed to download files using scp, rename folders using mv, list files with certain characters in their name and sort by size, modify file permissions with chmod, create directories and move files between them, extract information from files using commands like find and sort, concatenate files and compress the final folder for submission. The assignment is due on October 17, 2022 at 23:59 and no late submissions will be accepted.

Uploaded by

Can Kurtulan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Handout Lab1 Assignment

The document describes a Linux lab assignment that involves using various Linux commands like scp, mv, ls, chmod, vi/vim, mkdir, find, sort, pipe, concatenate and compress. Students are instructed to download files using scp, rename folders using mv, list files with certain characters in their name and sort by size, modify file permissions with chmod, create directories and move files between them, extract information from files using commands like find and sort, concatenate files and compress the final folder for submission. The assignment is due on October 17, 2022 at 23:59 and no late submissions will be accepted.

Uploaded by

Can Kurtulan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMP 201 - Fall 2022

Lab1 Assignment
Assigned: 14 October 2022, Due: 17 October 2022 23:59

The main aim of this assignment is to give you some insight into using basic commands of Linux. It
is required to perform this exercise and submit your work to Blackboard. You are required to perform all
operations using the Linux shell(using the linuxPool).

1. Download the exercise contents from the blackboard and unzip the compressed file.

• Then you need to copy the contents to the linuxPool machines by using scp command on your
local machine. Destination path ”[email protected]:” must not contain any
spaces.
1 s c p − r FOLDER NAME USERNAME@linuxpool . ku . edu . t r :

• To download a folder from the linuxPool machines to your local machine, you can use scp again
by changing the source and target address (you need to run this on your local machine).Once
again source and destination paths must not contain any spaces. After ”:” sign, you need to
specify the path in linuxpool server starting from the home directory. Then you can state the
destination directory in your local machine. For instance ”./” will download the files to current
working directory.
1 s c p − r USERNAME@linuxpool . ku . edu . t r : / PATH / TO / LINUXPOOL / FOLDER PATH / TO /
LOCAL / FOLDER

2. mv is a Unix command that moves one or more files or directories from one place to another. The
most common format of using this command is:
1 mv [ O p t i o n ] SOURCE DESTINATION

With the help of mv command rename the assignment folder that downloaded from blackboard and
uploaded to the linuxpool to Lab1Assignment.

3. Try to list all files that has ”q” in their name in the Lab1Assignment directory. This list needs to
be in human-readable format. This list has to be sorted according to files sizes.Then append this list
to q3.txt. Write down commands that you used to create this list and append it to q3.txt.

4. One of the parameter of the ls command is -l which shows all permission of the files in current
directory. Use this parameter to see permission of permission.txt file.

5. By using chmod command modify the permissions so that file owner would have read, write and
execute permissions; group owner would have read and write permissions; other users would not have
any of the permissions. After these modifications append detail information of this file including its

1
Figure 1: linuxpool file hierarchy for part 7

permission information to q5.txt. Append the command or commands that you used to change
permission to q5.txt.

6. There are quite a few editor available for linux bash. Use ’vi’ or ’vim’ editor to open q6.txt and
write down answers of the questions there.

7. Make a directory named SortedCountries under Lab1Assignment directory. Then under


SortedCountries folder make two other directories named as RList and ZList. Write all of
these commands to the file q9.txt.

8. There is a text file named countries.txt includes names of all the countries in separate lines.
Use a command to find number of countries in this file. Then use terminal commands to get a list of
countries inside countries.txt file which starts with the uppercase character ’R’ by piping. Store
this list in a text file under /Lab1Assignment/SortedCountries/RList directory. Do the
same procedure for country names which starts with the uppercase character ’Z’ and store the list in
a text file under /Lab1Assignment/ SortedCountries/ZList directoty. Write all of these
commands to the file q9.txt.

9. Concatenate the contents of two files created in part 8 and append them to q9.txt file.

10. After completing previous parts, you should compress your Lab1Assignment folder into zip or
tar.gz files, and submit it to the Blackboard.

Late Submission Policy


The due date for this assignment is 17 October Monday 2022 23:59. No submission after the deadline will
be accepted.

You might also like