KEMBAR78
Handout InLab1-LabA | PDF | Directory (Computing) | Computer File
0% found this document useful (0 votes)
43 views2 pages

Handout InLab1-LabA

This document provides instructions for an in-lab assignment on LinuxPool machines. Students are asked to: 1) Download and copy files to their LinuxPool account 2) Navigate directories, create files, and redirect file listings 3) Examine file contents using cat and grep 4) Create a new file using vi or vim Students should save their answers and file listings in text files and submit them through Blackboard.

Uploaded by

Can Kurtulan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views2 pages

Handout InLab1-LabA

This document provides instructions for an in-lab assignment on LinuxPool machines. Students are asked to: 1) Download and copy files to their LinuxPool account 2) Navigate directories, create files, and redirect file listings 3) Examine file contents using cat and grep 4) Create a new file using vi or vim Students should save their answers and file listings in text files and submit them through Blackboard.

Uploaded by

Can Kurtulan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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

You might also like