程序代写案例-COMP-206-Assignment 1

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
School of Computer Science, McGill University
COMP-206 Introduction to Software Systems, Winter 2021
Mini Assignment 1: Familiarizing yourself with Linux
Due Date Jan 27th, 18:00 EST
This is an individual assignment. You need to solve these questions on your own. If you have ques-
tions, post them on Piazza, but do not post major parts of the assignment code. Though small parts
of code are acceptable, we do not want you sharing your solutions (or large parts of them) on Piazza.
If your question cannot be answered without sharing significant amounts of code, please make a pri-
vate question on Piazza or utilize TA/Instructors office hours. Late penalty is -15% per day. Even if
you are late only by a few minutes it will be rounded up to a day. Maximum of 2 late days are allowed.
You MUST use mimi.cs.mcgill.ca to create the solution to this assignment. You must not use your
Mac command-line, Windows command-line, nor a Linux distro installed locally on your laptop. You can access
mimi.cs.mcgill.ca from your personal computer using ssh or putty as seen in class and in Lab A. All of your
solutions should be composed of commands that are executable in mimi.cs.mcgill.ca.
Questions in this assignment require you to take screenshots of your work. This will serve as proof that you have
done this assignment by yourself. Instructors/TAs upon their discretion may ask you to demonstrate/explain your
solution. No points are awarded for commands that do not execute at all. (Commands that execute, but provide
incorrect behavior/output will be given partial marks.) All questions are graded proportionally. This means that if
40% of the question is correct, you will receive 40% of the grade. Please read through the entire assignment
before you start working on it. You can loose up to 3 points for not following the instructions.
Lab A provides some background help for this mini assignment.
Total Points: 20
Ex. 1 — Familiarizing yourself with the File System (7 Points)
1. (3 Points) Your first task is to create a folder structure similar to the one given below, immediately under your
home directory in mimi. The structure below represents a typical directory hierarchy that can be employed in
developing complex software applications or working on your CS courses. Below, courses is a subdirectory
of your home directory (∼), COMP206 is a subdirectory of courses, asgn1 is a subdirectory of COMP206, and
so forth. After you have created the necessary directories, from your home directory, execute the following
command.
$ tree courses
This will display a folder heirarchy. Take a screen shot as an image and turn it in as EX1 1.PNG or
EX1 1.JPG
1
(Your Home Directory [∼])
courses
COMP206
asgn1
archive backup docs
html txt
assets database src
sh c
2. (2 Points) Next, starting from you home directory, use the pwd command to show that you are in your home
directory. Then, perform the change directory command, cd, to the asgn1 directory that you just created
in the above step. Now use the pwd command to show that you are in the asgn1 directory. The directory
change MUST be performed using a single cd command execution that will take you directly from your home
directory to the asgn1 directory.
3. (2 Points) Now use the ls command to list all the directories that are immediately under the asgn1 direc-
tory. The listing should also include the permissions and the owner/group names associated each directory.
(Therefore, this should demonstrate that you are the owner of these directories).
Turn in a screen shot of your shell that shows clearly that you executed the pwd and cd com-
mands from the previous question and the ls command. The screenshot must be an image,
either EX1 2.PNG or EX1 2.JPG.
Ex. 2 — Exploring the files (7 Points)
1. (a) (2 Points) Use the cd command(s) to move to the docs directory.
From here, copy the file /home/2013/jdsilv2/206/philosophy.txt into the docs directory using the
cp command.
(b) (1 Point) From inside the docs directory, execute the pwd command.
(c) (1 Point) From within the docs directory, execute the ls command. Make sure that the ls command
show that the file was created by your user id, and its time stamp.
(d) (1 Point) Next, cat the file you just copied to display its contents.
Turn in a screen shot that shows the cp, pwd, ls, and cat commands and the output that they
produce. Include all of it in a single screen shot, EX2 1.PNG or EX2 1.JPG.
2. (a) (1 Point) From within the docs directory, execute the pwd command.
(b) (1 Point) Now make a copy of the philosophy file to the backup directory that you had created before,
with a new name, philosophy old.txt, by using the cp command (You MUST execute the cp command
from the docs directory).
Turn in a screen shot that shows the pwd, cp commands and the output (if any) that they pro-
duce. Include all of it in a single screen shot, EX2 2.PNG or EX2 2.JPG.
2
Ex. 3 — Using grep (3 Points)
From the docs directory, use pipe to make the ls and grep commands (with appropriate arguments to them)
to interact such that it produces the following output. (You would of course have different owner/group names,
permissions, file sizes and time stamp for your output. However, the names and order of the files and the content
format of the output should be the same.)
-rw------- 1 jdsilv2 root 116 Jan 17 17:31 philosophy.txt
drwx------ 2 jdsilv2 root 2 Jan 17 17:27 txt
Turn in a screen shot that shows the command you executed and the output that it produces as
EX3.PNG or EX3.JPG.
Ex. 4 — Transfering files to and from Mimi (3 Points)
1. In this exercise, you are going to transfer files between your personal computer and mimi using the File
Transfer Protocol (FTP). Using your File Transfer program of choice (we recommend FileZilla or WinSCP),
begin by connecting to mimi.cs.mcgill.ca (sftp://mimi.cs.mcgill.ca if using FileZilla) .
2. (2 Points) In your File Transfer program, on the remote side (right), make your way to the backup directory
under asgn1 and upload the screenshots taken for the previous exercises from your personal computer to
mimi. Take a screenshot of the File Transfer program window showing that the files have been
uploaded to mimi. Turn it in as EX4.PNG or EX4.JPG
3. (1 Point) Again using your File Transfer program of choice, download the philosophy.txt file you copied in
Exercise 2.1. Turn in your philosophy.txt file.
WHAT TO HAND IN
Turn in philosophy.txt with the six screen shots, named properly as mentioned above (so that the TA can identify
which screen shot is for which which question). You do not have to zip all of the filesk together. You must upload
all of these files to mycourses under the mini 1 folder.
FOOD FOR THOUGHT!
The following discussion is meant to encourage you to search independently for creative and optimal ways to perform
rudimentary tasks with less effort and does not impact the points that you can achieve in the above questions.
• Can you find a way in which you can create all the directories using a single command in Exercise 1.1?
• Can you execute the copy command in such a way so that the timestamp of philosophy old.txt ends up
being the same as that of philosophy.txt (the one in your docs directory) in Exercise 2.2?
3

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468