Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

42 bytes removed, 06:30, 2 June 2021
Part 2: Viewing Directory Contents / Copying & Moving Directories
=INVESTIGATION 1: CREATING & MANAGING DIRECTORIES=
<span style="color:red;">'''ATTENTION''': Depending on your ULI101 instructioninstructor, you may be required to complete this tutorial for '''marks ''' in the this course.<br>Please refer to your instructor's course notes in terms of marked assigned to the and lecture notes regarding evaluation for this course.<br><br>The due date for successfully completing this tutorial (i.e. '''tutorial 2''') is by '''Friday by midnight''' next week (egi.e. '''Week 3''').<br>If your instructor has NOT assigned marks for completing this tutorial, you can perform it for '''practice purposes'''.</span><br><br>
In this investigation, you will learn how to '''create''', '''navigate''', '''list directory contents''' and '''remove''' directories in your Matrix account.
# Make certain that your current directory is '''your home directory'''.<br><br>
# Issue the following Linux command to run a checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/myscripts~uli101/week2-check-1</span><br><br>
# If you encounter errors, then view the feedback to make corrections, and then re-run the checking script. If you receive a congratulation message that there are no errors, then proceed to the next part.
<br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -lR uli101xxx</span><br><br>Note the differences between both of these commands (i.e. using and <u>not</u> using a pathname).<br><br>You can copy and move entire directories (and their contents) to other directories.<br><br><table align="right"><tr valign="top"><td>[[Image:directory-structure-7.png|thumb|right|250px|Output of the '''tree''' command to confirm copy of '''uli101xx''' directory (and contents) to the '''xyz100xx''' directory.]]</td><td>[[Image:directory-structure-8.png|thumb|right|300px|Output of the '''tree''' command to confirm movement of '''acp100 directory''' directory (and contents) to the '''xyz100xx''' diredtory.]]</td></tr></table>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">cp -R uli101xx xyz100xx</span><br><br>
#Issue the following Linux command to display the directory structure of your home directory to confirm you copied the uli101xx directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">tree </span><br><br><br><br><br><br>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">mv acp100xx xyz100xx/uli101xx/tutorials</span><br><br>
#Issue the following Linux command to display the directory structure of your home directory to confirm you moved the acp100xx directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">tree </span><br><br>Let's run a checking script to see if you moved and copied the directories correctly.<br><br>
# Make certain that your current directory is '''your home directory'''.<br><br>
# Issue the following Linux command run checking script:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/myscripts~uli101/week2-check-2</span><br><br>
# If you encounter errors. make corrections and re-run the checking script until you receive a congratulations message, and proceed to the next investigation.<br><br>
# Issue the following Linux command (entering "y" when prompted): <span style="color:blue;font-weight:bold;font-family:courier;">rm -ri xyz100xx</span><br><br>'''NOTE:''' You should have removed all directories that you have created.<br><br>Let's run a checking script to confirm that you have correctly removed all of those directories.<br><br>
# Issue the '''tree''' command to confirm that all of those recently created directories have been removed.<br><br>
# Issue the following Linux command to run a checking script to confirm removal of those directories:<br><span style="color:blue;font-weight:bold;font-family:courier;">bash /home/murray.saul/myscripts~uli101/week2-check-3</span><br><br>
# If you encounter errors, make corrections and re-run the checking script until you receive a congratulations message, and proceed to the next INVESTIGATION.<br><br>
13,420
edits

Navigation menu