Difference between revisions of "OPS705 Lab 3 (2221)"

From CDOT Wiki
Jump to: navigation, search
(Lab Submission)
m (Chris.johnson moved page OPS705 Lab 3 to OPS705 Lab 3 (2221) without leaving a redirect: Archive copy.)
 
(6 intermediate revisions by the same user not shown)
Line 25: Line 25:
 
# Connect to the VM remotely using SSH
 
# Connect to the VM remotely using SSH
 
# Navigate to your home directory with this command: <code>cd ~</code>
 
# Navigate to your home directory with this command: <code>cd ~</code>
# In your home directory, recreate the directory tree in Figure 1. (''yourusername'' should be your own username home folder that already exists.)
+
# In your home directory, recreate the yellow portion of the directory tree in Figure 1. (''yourusername'' should be your own username home folder that already exists.)
# Using vim, create a new file called ''yourusername''_lab3.txt in your home directory, and add the following text: <code>My name is ''insertFullName'', and I've completed the CentOS VM investigation.</code>
+
# Using vim, create a new file called ''yourusername''_lab3.txt in your home directory, and add the following text: <code>My name is ''insertFullName'', and I've completed Investigation 1.</code>
  
 
= INVESTIGATION 2: Moving Files =
 
= INVESTIGATION 2: Moving Files =
In this investigation, you're tasked with moving a set of existing files. You will download and run a script, which will create a set of files in '''~/tmp'''. It is then your job to create the directory structure seen in Figure 2, and move the files from '''~/tmp''' to their proper location according to the file tree diagram. '''Do not delete and recreate files, and do not delete your work from Investigation 1.'''
+
In this investigation, you're tasked with '''moving''' a set of existing files. You will download and run a script, which will create a set of files in '''~/tmp'''. It is then your job to create the directory structure seen in Figure 2, and move the files from '''~/tmp''' to their proper location according to the file tree diagram. '''Do not delete and recreate files, only move files, and do not delete your work from Investigation 1.'''
[[Image:Ops705_lab3_fig2.png|thumb|right|250px|Figure 2. Square icons are directories, oval icons are empty text files.]]
+
[[Image:Ops705_lab3_fig2.png|thumb|right|250px|Figure 2. Square icons are directories, oval icons are script-generated text files.]]
  
# On your Linux VM, from your home directory, download script for this lab with the following command: <code>wget https://ict.senecacollege.ca/~chris.johnson/ops705/lab3_generate.sh</code>
+
# On your Linux VM, from your home directory, download script for this lab with the following command: <code>wget https://raw.githubusercontent.com/ops705/labs/main/lab3_generate.sh</code>
 
# Give the script execute permissions: <code>chmod u+x ~/lab3_generate.sh</code>
 
# Give the script execute permissions: <code>chmod u+x ~/lab3_generate.sh</code>
 
# Run the script: <code>~/lab3_generate.sh</code>
 
# Run the script: <code>~/lab3_generate.sh</code>
Line 40: Line 40:
  
 
= Lab Submission =
 
= Lab Submission =
# In your home directory, download the check script for this lab: <code>wget https://ict.senecacollege.ca/~chris.johnson/ops705/lab3_check.sh</code>
+
# In your home directory, download the check script for this lab: <code>wget https://raw.githubusercontent.com/ops705/labs/main/lab3_check.sh</code>
 
# Give the script execute permissions: <code>chmod u+x ~/lab3_check.sh</code>
 
# Give the script execute permissions: <code>chmod u+x ~/lab3_check.sh</code>
 
# Run the script: <code>~/lab3_check.sh</code>
 
# Run the script: <code>~/lab3_check.sh</code>
  
 
Submit to Blackboard's ''Lab Submission'' section full-desktop screenshots (PNG/JPG) of the following:
 
Submit to Blackboard's ''Lab Submission'' section full-desktop screenshots (PNG/JPG) of the following:
# The entire output of the lab check script.
+
# The entire output of the lab check script in a '''passed''' state.
  
 
Your professor will review your VMs directly; the screenshots are a backup in case of catastrophic issues.
 
Your professor will review your VMs directly; the screenshots are a backup in case of catastrophic issues.

Latest revision as of 07:28, 23 September 2022

LAB PREPARATION

Purpose / Objectives of Lab 3

In this lab, you will practice working with the Linux command line by manipulating the file system in two separate investigations.

If you encounter technical issues, please contact your professor via e-mail or in your section's Microsoft Teams group.

Minimum Requirements

Before beginning, you must have:

  1. Successfully completed Lab 2
  2. Watched the Week 3 video lecture
  3. Read through the Week 3 slides, and have them handy as a reference for concepts
  4. Your Seneca Azure login credentials
  5. Your linked mobile device for 2FA

INVESTIGATION 1: Create the Directory Structure

Figure 1. Square icons are directories, oval icons are empty text files.

In this investigation, you'll create the directory structure and text files you see in the tree diagram below. You will do so entirely on the command line using the utilities and command provided to you in the Week 2 lecture.

You work will be done entirely in your home directory.

To begin:

  1. Start your CentOS Linux VM in Azure (this may take a few minutes)
  2. Connect to the VM remotely using SSH
  3. Navigate to your home directory with this command: cd ~
  4. In your home directory, recreate the yellow portion of the directory tree in Figure 1. (yourusername should be your own username home folder that already exists.)
  5. Using vim, create a new file called yourusername_lab3.txt in your home directory, and add the following text: My name is insertFullName, and I've completed Investigation 1.

INVESTIGATION 2: Moving Files

In this investigation, you're tasked with moving a set of existing files. You will download and run a script, which will create a set of files in ~/tmp. It is then your job to create the directory structure seen in Figure 2, and move the files from ~/tmp to their proper location according to the file tree diagram. Do not delete and recreate files, only move files, and do not delete your work from Investigation 1.

Figure 2. Square icons are directories, oval icons are script-generated text files.
  1. On your Linux VM, from your home directory, download script for this lab with the following command: wget https://raw.githubusercontent.com/ops705/labs/main/lab3_generate.sh
  2. Give the script execute permissions: chmod u+x ~/lab3_generate.sh
  3. Run the script: ~/lab3_generate.sh
  4. Check that the files 13-17 have been created in ~/tmp (These must come from the script, do not create them yourself)
  5. Using Figure 2 as a model, create the ~/shared directory structure
  6. Using Figure 2 as a model, move the files from ~/tmp to their proper location in ~/shared

Lab Submission

  1. In your home directory, download the check script for this lab: wget https://raw.githubusercontent.com/ops705/labs/main/lab3_check.sh
  2. Give the script execute permissions: chmod u+x ~/lab3_check.sh
  3. Run the script: ~/lab3_check.sh

Submit to Blackboard's Lab Submission section full-desktop screenshots (PNG/JPG) of the following:

  1. The entire output of the lab check script in a passed state.

Your professor will review your VMs directly; the screenshots are a backup in case of catastrophic issues.

Your professor will not check your lab until the screenshots have been submitted.

Make sure to fully stop your VMs when you're done!