Starting from:

$24.99

COMP201 Lab 1 Solution

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 ”USERNAME@linuxpool.ku.edu.tr:” must not contain any spaces.
scp −r FOLDER NAME USERNAME@linuxpool . ku . edu . t r :
1
• 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.
scp −r USERNAME@linuxpool . ku . edu . t r : /PATH/TO/LINUXPOOL/FOLDER PATH/TO/
LOCAL/FOLDER
1
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:
mv [ Option ] SOURCE DESTINATION
1
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.
2

More products