COMP 201 - Fall 2022
Handout for In-Lab1 Assignment - LabA
Please enter your answers in related text files and, then upload q2-answer.txt, q3-answer.txt and,
q4-answer.txt files to Blackboard.
1. Download the in-lab1-LabA 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.
1 s c p − r FOLDER NAME USERNAME@linuxpool . ku . edu . t r :
• Now, InLab1-LabA folder should be on your LinuxPool machines.
2. Change the directory with the appropriate command to /InLab1-LabA/files/folder3.
• Make a new and empty text file in the current directory named ’0.c’.
• Try to list all files that exist in /InLab1-LabA/files/folder3 directory and files that
exist in subdirectories of this directory in the long list and size sorted format
• Redirect the list of previous part to q2-answer.txt file and mention which command is
used for creating this list. (Hint: According to the fact that q2-answer.txt file is under
another directory, you need to use one of the absolute or relative addressing methods during the
redirecting)
• Append the text ”*****Question-2 Part-2*****” to the q2-answer.txt before moving on
to the next part.
• Change current working directory to /InLab1-LabA/files/folder3.
• Try to list all files that exist in /InLab1-LabA/files/folder3 directory in the long list
and reverse size sorted format.
• Once again redirect the list to q2-answer.txt file and mention which command is used for
creating this list
3. Change the directory with the appropriate command to /InLab1-LabA.
• Use ’cat’ command to display the content of RemoveVowels.c file.
• Use ’–help’ parameter for ’cat’ command to see the usage of other parameters.
• Append all lines of RemoveVowels.c file to q3-answer.txt with their corresponding line
numbers are shown.
1
• With the help of the ’grep’ command, find all lines containing the ’p’ character in RemoveVowels.c
file. Enter the command that you used for this part in q3-answer.txt.
4. By using vi or vim editors create a file fruits.txt with a list of three of your favorite fruit names
on separate lines in the current directory. To use these editors, enter FILENAME after vi/vim com-
mand, then choose the appropriate mode. Make your changes, answer the questions, and close the file
by saving the changes.
• Briefly mention the steps that you followed to create this list in q4-answer.txt.
• Is there any other solution to gain the same result with fewer commands? Explain your answer
in q4-answer.txt.
Note that when you want to download a file or folder from the linuxPool machines to your local ma-
chine, you can use scp again by changing the source and target address (you need to run this on your local
machine).
1 s c p − r USERNAME@linuxpool . ku . edu . t r : / PATH / TO / FOLDER NAME