Open main menu

CDOT Wiki β

Changes

Tutorial 2 - Unix / Linux File Management

2,793 bytes added, 12:14, 8 June 2023
m
Protected "Tutorial 2 - Unix / Linux File Management": OER transfer ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
=INVESTIGATION 1: CREATING & MANAGING DIRECTORIES=
<span style="color:red;">'''ATTENTION''': The due date for successfully completing this tutorial (i.e. tutorial 2) is by Friday, November 5th by midnight by March 10 @ 11:59 PM (Week 8).</span><br><br>
In this investigation, you will learn how to '''create''', '''navigate''', '''list directory contents''' and '''remove''' directories in your Matrix account.
# Issue the following Linux command to remove all of the directories that you have created:<br><span style="color:blue;font-weight:bold;font-family:courier;">rm -r osl640xx osm620xx nwk680xx</span><br><br>
# Issue a Linux command to confirm that the '''osl640xx''', '''osm620xx''' and '''nwk680xx''' that been removed.<br><br>
# Issue the following single Linux command to create the entire directory structure:<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir -p osl640xx/notes osl640xx/tutorials osl640xx/samples osm620xx nwk680xx</span><br><br>'''NOTE:''' The '''-p''' option allows "parent" directories to be automatically created first to then create their subdirectories.<br><br>
# Issue the following Linux command to confirm that all of the directories have been created:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -ld osl640xx/ osl640xx/notes osl640xx/tutorials osl640xx/samples osm620xx nwk680xx</span>
<br><br>
= LINUX PRACTICE QUESTIONS =
 
The purpose of this section is to obtain '''extra practice''' to help with '''quizzes''', your '''midterm''', and your '''final exam'''.
 
Here is a link to the [https://matrix.senecacollege.ca/~osl640/questions/osl640_week2_practice.docx MS Word Document of ALL of the questions] displayed below but with extra room to answer on the document to
simulate a quiz:
 
Your instructor may take-up these questions during class. It is up to the student to attend classes in order to obtain the answers to the following questions. Your instructor will NOT provide these answers in any other form (eg. e-mail, etc).
 
 
'''Review Questions:'''
 
For each of the following questions, use a pathname starting from the '''root''' directory (i.e. “/”).<br><br>
 
[[Image:tree-diagram.png|right|350px|thumb|]]
# Write a single Linux command to create the directory structure starting from your home directory from the diagram displayed on the right.
# Write a Linux command to display a detailed listing of '''history''' directory.<br>How would this command differ if you wanted to also view hidden files as well?<br>
# Write a Linux command to change to the '''project''' directory.<br>What command would you issue to return to your home directory?<br>
# Write a Linux command to copy the '''project''' directory and its contents to the '''history''' directory.
# Write a Linux command to move the directory called '''directories''' to the '''history''' directory.
# Write a Linux command to remove both directories named '''1''' and '''2'''.
# Write a Linux command to remove the '''concepts''' directory and its contents.
# Write a Linux command to remove the '''concepts''' directory and prompt the user if they want to remove this directory’s contents.<br><br>
# Write a single Linux command to create the following empty files in the concepts directory:<br>'''myfile.txt'''<br>'''yourfile.txt'''<br>'''thefile.txt'''<br>
# Write a Linux command to view the contents of the myfile.txt text file to prove it is empty.<br>What is the difference between the commands: '''cat''', '''more''' and '''less'''?
# Write a Linux command to sort the contents of a file called '''practice/customers.txt'''
# Write a Linux command to display the first 4 lines of a file called '''practice/customers.txt'''
# Write a Linux command to display the last line of a file called '''practice/customers.txt'''
# Write a Linux command to match a line containing the pattern '''Linux''' in a file called '''practice/customers.txt'''
# Write a Linux command to display unique occurrences of consecutive lines in a file called '''practice/customers.txt'''
# Create a '''table''' listing each Linux command, useful options that are displayed near the top of this tutorial labelled: '''Tutorial Reference Material'''
 
 
[[Category:OSL640]]