Handout Lab1 Assignment
Handout Lab1 Assignment
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.
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.