COMP-206 Introduction to Software Systems
Mini Assignment 1: Familiarizing yourself with Linux
This is an individual assignment. You need to solve these questions on your own. If you have
questions, 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
private question on Piazza or utilize TA/Instructors office hours. Late penalty is -5% 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 and lab B provide some background help for this mini assignment.
Total Points: 20
Ex. 1 — Familiarizing yourself with the File System (6 Points)
1. (2 Points) Your first task is to create a folder structure similar to the one given below, immediately under
your home directory. The structure below represents a typical directory hierarchy that can be employed in
developing complex software applications. Below, Projects is a subdirectory of your home directory (∼),
COMP206 is a subdirectory of Projects, asgn1 is a subdirectory of COMP206, and so forth. Nothing to be
turned in for this question.
(Your Home Directory [∼])
archive backup docs
assets database src
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 directory. 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 commands from the previous question and the ls command. The screenshot must be an image,
either EX1.PNG or EX1.JPG.
Ex. 2 — Editing Files with vi (8 Points)
1. (a) (3 Points) In the docs directory, create a file by name license.txt using the vi editor. Enter the
following contents in it.
Copyright : <your full name>, <year> – All Rights Reserved
Email : <your email address>
Dept : <name of your department>
(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 license file you just created to display its contents.
Turn in a screen shot that shows the 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 license file to the backup directory that you had created before, with
a new name, license 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 produce. Include all of it in a single screen shot, EX2 2.PNG or EX2 2.JPG.
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 133 Dec 20 12:21 license.txt
drwx—— 2 jdsilv2 root 2 Dec 20 11:24 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 license.txt file you created in
Exercise 2.1. Turn in your license.txt file.
WHAT TO HAND IN
Turn in license.txt with the 5 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.
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 license old.txt ends up being
the same as that of license.txt in Exercise 2.2?