Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

421 bytes added, 01:29, 24 September 2022
Adds extension notice.
=UNIX / LINUX FILE MANAGEMENT CONCEPTS=
{{Admon/important|IMPORTANT: The due date for this tutorial has been extended to Monday, September 26, 2022 at 11:59pm EST.|This extension is for all sections of ULI101.}}
<br>
===Main Objectives of this Practice Tutorial===
=INVESTIGATION 1: CREATING &amp; MANAGING DIRECTORIES=
<span style="color:red;">'''ATTENTION''': Effective '''May 9, 2022''' - this This online tutorial will be required to be completed by '''Friday in week 3 by midnight'''<br>to obtain a grade of '''2%''' towards this course</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: <span style="color:blue;font-weight:bold;font-family:courier;">ls -ld /home/your-seneca-id/uli101xx</span><br><br>Is the output from this command the same was the output from the previous command?<br>If so, what does this say about how to use multiple options for Linux commands?<br><br>
# Issue the following Linux command to create the '''acp100xx''' and '''xyz100xx''' directories:<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir /home/your-seneca-id/acp100xx /home/your-seneca-id/xyz100xx</span><br><br>'''NOTE:''' You can create multiple directories by issuing the '''mkdir''' command with <u>multiple arguments</u>.<br><br>
# Issue the following Linux command to confirm that those directories have been created:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -ld /home/your-seneca-id/acp100xx /home/your-seneca-id/xyz100xx</span><br><br>'''Using a FULL pathname starting from the root directory (i.e. /) requires is a LOT of typing!.<br>Since we are already located in our home directory, we don't have to start from<br>the root directory . This is called a "relative" pathname.'''<br><br>
# We will now create the subdirectories that are contained in the '''uli101xx''' directory.<br>Issue the following Linux command to move to the '''uli101xx''' directory using a '''relative''' pathname:<br><span style="color:blue;font-weight:bold;font-family:courier;">cd uli101xx</span><br><br>
# Issue a Linux command to confirm that your current location is in the ''uli101xx'' directory.<br>You should know how to issue this command from a previous tutorial.<br><br>
# Issue a Linux command to confirm that you are now located in your home directory.<br><br>Although we will teach you how to '''remove''' directories and their contents in another investigation,<br>let's remove the created directory structure' and '''recreate''' the same directory structure<br>using just <u>one</u> command using pathnames.<br><br>
# 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 uli101xx acp100xx xyz100xx</span><br><br>
# Issue a Linux command to confirm that the '''uli101xx''', '''acp100xx''' and '''xyz100xx''' that directories have 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 uli101xx/notes uli101xx/tutorials uli101xx/samples acp100xx xyz100xx</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 uli101xx/ uli101xx/notes uli101xx/tutorials uli101xx/samples acp100xx xyz100xx</span>
<table align="right"><tr valign="top"><td>[[Image:script-check-1.png|thumb|right|250px|If all all check checks pass, then user performed task correctly and can continue.]]</td><td>[[Image:script-check-2.png|thumb|right|450px|If there is a warning, then feedback is provided to user to correct and re-run checking script.]]</td></table>
To check for mistakes, a '''shell script''' has been created to check your work. If the checking shell script detects an '''error''', then it will provide feedback and offer constructive feedback on how to fix that problem so you can re-run the checking shell scripts until your work is correct.
# Issue the same command that you performed in '''Step #2''' to confirm that you had properly edited that file.<br><br>
# '''Save''' and '''exit''' your vi editing session.<br><br>[[Image:vi-text-editor-2.png|right|250px|thumb|The online vi-tutorial provides users "hands-on" experience of using the vi text editor.]]An '''online tutorial''' has been created to give you "hands-on" experience on how to use vi text editor. It is <u>recommended</u> that you run this online tutorial in your Matrix account to learn how to create and edit text files with the vi text editor.<br><br>
# Issue the following to run the vi online tutorial:<br><span style="color:blue;font-weight:bold;font-family:courier;">/home/murrayjason.saulcarman/vi-tutorial<br><br>
# In the tutorial menu, select the first menu item labelled "'''USING THE VI TEXT EDITOR'''"<br><br>
#Read and follow the instructions in the tutorial. Eventually, it will display a '''simulated''' vi environment<br>and will provide you with "'''hands-on'''" practice using the vi text editor. As far as this author is aware,<br>there is NO "hands-on" tutorial for the nano text editor in this particular format.<br><br>
# 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'''
 
 
_________________________________________________________________________________
 
Author: Murray Saul
 
License: LGPL version 3
Link: https://www.gnu.org/licenses/lgpl.html
 
_________________________________________________________________________________
 
[[Category:ULI101]]

Navigation menu