13,420
edits
Changes
→Part 2: Viewing Directory Contents / Copying & Moving Directories
=UNIX / LINUX FILE MANAGEMENMANAGEMENT CONCEPTS=
<br>
===Main Objectives of this Practice Tutorial===
:* xUnderstand the purpose of '''directories''' and '''directory pathnames'''.
:* xUse common '''Unix / Linux commands''' to perform '''directory management''' tasks.
:* xUse '''Text Editors''' to create and modify text files
:* xUse Common Unix / Linux commands to '''manage''' and '''manipulate''' text files. :* x :* x :* x<br><br>
===Tutorial Reference Material===
|- valign="top"
|colspan="21" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;"|Course Notes / Software<br>
|colspan="2" style="font-size:16px;font-weight:bold;border-bottom: thin solid black;border-spacing:0px;padding-left:15px;"|Linux Command/Shortcut Reference<br>
|- valign="top" style="padding-left:15px;"
|colspan="21" |Course NotesSlides:<ul><li>[https://ict.senecacollege.ca/~murray.saul/uli101/notes/Week02ULI101-Week2.pdf PDF] | [https://ict.senecacollege.ca/~murray.saul/uli101/notes/Week02ULI101-Week2.pptx PPTX]</li></ul>Tutorials:<ul><li>[http://www.cheat-sheets.org/saved-copy/Nano_Cheat_Sheet.pdf Nano Reference Sheet (PDF)]</li><li>[https://www.smashingmagazine.com/2010/05/vi-editor-linux-terminal-cheat-sheet-pdf Vi Reference Sheet(PDF)]</li><li>[http://czegel.com/seneca/uli101/lectures/Lecture2.html Les Czegel's Week 2 Notes (HTML)]</li></ul>
| style="padding-left:15px;" |Directory and File Management Commands
*[http://man7.org/linux/man-pages/man1/pwd.1.html pwd]<br>
*[http://man7.org/linux/man-pages/man1/cd.1p.html cd]<br>
*[http://man7.org/linux/man-pages/man1/ls.1p.html ls]<br>
*[https://www.systutorials.com/docs/linux/man/1-tree/ tree]<br>
*[http://man7.org/linux/man-pages/man1/mkdir.1.html mkdir]<br>
*[http://man7.org/linux/man-pages/man1/rmdir.1.html rmdir]<br>
*[http://man7.org/linux/man-pages/man1/rm.1.html rm] , [http://man7.org/linux/man-pages/man1/rm.1.html rm -r]<br>
| style="padding-left:15px;"|Text Editors /<br>File Management CommandsContent*[http://man7.org/linux/man-pages/man1/vi.1p.html vi] , *[https://linux.die.net/man/1/nano nano]<br>
*[http://man7.org/linux/man-pages/man1/cat.1.html cat]<br>
*[http://man7.org/linux/man-pages/man1/more.1.html more] , [http://man7.org/linux/man-pages/man1/less.1.html less]<br>
* [http://man7.org/linux/man-pages/man1/head.1.html head] , [http://man7.org/linux/man-pages/man1/tail.1.html tail]
*[http://man7.org/linux/man-pages/man1/touch.1.html touch]<br>
*[http://man7.org/linux/man-pages/man1/file.1.html file]<br>
*[http://man7.org/linux/man-pages/man1/find.1.html find]<br>
*[http://man7.org/linux/man-pages/man1/diff.1.html diff]<br>
|colspan="1" style="padding-left:15px;" width="30%"|Brauer Instructional Videos:<ul><li>[https://www.youtube.com/watch?v=UfAFAipked0&list=PLU1b1f-2Oe90TuYfifnWulINjMv_Wr16N&index=3 Basic File Actions<br>(touch, ls -l, cp, cp -r, mv, mkdir, mkdir -p, rm, rmdir, rm -r)]</ul>
|}
===Unix / Linux Directories=== [[Image:directory-structure-1.png|}thumb|right|350px|In Unix / Linux (as opposed to MS Windows), there are no drive letters (such as '''C:''', or '''D:''').<br><br> All files and directories appear under a single ancestor directory called "the '''root''' directory".]]To better '''organize''' files (eg. text, images, documents, spreadsheets, programs) within your Matrix account, they should be stored in '''directories'''. To further organize <u>many</u> files, directories<br> may contain '''sub-directories'''.
=== Directory Pathnames ===
[[Image:path-name.png|thumb|right|180px|A pathname points to a file system location by '''following the directory tree hierarchy'''.]]
<i>A '''pathname''' is used to specify a '''route to a file''' within the file system.<br>
<br>
'''Perform the Following Steps:'''
# '''Login''' to your matrix account (you should know how to do this from performing [https://wiki.cdot.senecacollege.ca/wiki/Tutorial_1:_Using_Your_Matrix_Server_Account#INVESTIGATION_1:_ACCESSING_YOUR_MATRIX_LINUX_ACCOUNT Tutorial 1 INVESTIGATION 1]]).<br><br># Issue a command to '''confirm''' that you are located in your home directory<br>(you should know how to do this from performing [[https://wiki.cdot.senecacollege.ca/wiki/Tutorial_1:_Using_Your_Matrix_Server_Account#INVESTIGATION_2:_USING_THE_LINUX_SHELL_.2F_ONLINE_ASSIGNMENTS Tutorial 1 INVESTIGATION 2]]<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">mkdir /home/your-seneca-id/uli101xx</span><br>(remember: use <u>your</u> Seneca username instead of "your-seneca-id")<br><br>'''NOTE:''' You should always confirm that you have created a directory.<br>This can be done by issuing the '''ls''' command.<br><br>[[Image:directory-structure-4.png|thumb|right|350px|'''Creating''' and '''Confirming''' the Creation of a Directory.]]# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls /home/your-seneca-id/uli101xx</span><br><br>There are no contents that are contained in this newly-created directory; therefore, no contents appear. A useful option '''-d''' can be used to confirm that the actual <u>directory</u> has been created as opposed to viewing the contents of the directory.<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -d /home/your-seneca-id/uli101xx</span><br><br>You should now see just the directory listed. You can also combine the '''-d''' and '''-l''' options to provide more detail regarding the newly-created directory.<br><br># Issue the following Linux command: <span style=Part 2"color:blue;font-weight:bold;font-family:courier;">ls -d -l /home/your-seneca-id/uli101xx</span><br><br>How can you confirm from the output of this command that the file uli101xx is a directory?<br><br># 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 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 the following Linux command to create the directories called '''notes''', '''tutorials''' and '''samples''':<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir notes tutorials samples</span><br><br># Issue a Linux command to confirm that those directories have been created<br>(you should already know how to do this).<br><br>There are better ways to create the same directory structure without using the '''cd''' command.<br><br>Issuing the '''cd''' command '''<u>prior</u>''' to issuing other commands indicates to others that you are a novice or "'''newbie'''".<br>You can actually '''lose marks''' on quizzes or tests if you issue multiple Linux commands to performed tasks that can be performed<br>using a single Linux command with '''pathnames'''.<br><br># Issue the following Linux command to return to your home directory: <span style="color:blue;font-weight:bold;font-family: Creating courier;">cd</ Copying span><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</ Moving 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</ Removing Files span><br><br># Issue a Linux command to confirm that the '''uli101xx''', '''acp100xx''' and '''xyz100xx''' 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 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><br><br>'''Running a Shell Script to Check your Work''' Although you are being asked to create the directory structure, you might have made some mistakes:<br>For Example:<br> * Forgetting to create a directory.* Making syntax errors (eg. spelling or mixing up character case)* Not creating subdirectories within specified directories. <table align="right"><tr valign="top"><td>[[Image:script-check-1.png|thumb|right|250px|If all all check 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.
'''Perform the Following Steps:'''
# xMake 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;">~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> ===Part 2: Viewing Directory Contents / Copying & Moving Directories===
Now that you have learned how to efficiently create your directory structure, you will now learn how to issue Linux commands<br>to '''view directory contents''' as well as '''copy''' and '''move''' directories.
'''Perform the Following Steps:'''<table align="right"><tr valign="top"><td>[[Image:directory-structure-5.png|thumb|right|250px|Output of the '''tree''' command to display directory structure.]]</td><td>[[Image:directory-structure-6.png|thumb|right|250px|Output of the '''ls -R''' command to display directory structure.]]</td></table># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">tree</span><br><br>'''NOTE:''' You should see the directory structure that you created in the previous investigation. You can also issue the '''tree''' command using a directory pathname to display the directory structure for a specific scope.<br><br>You can also use the '''-R''' option for the '''ls''' command to display all directories and subdirectories for a specified directory path (referred to as a '''recursive directory listing''').<br><br># Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ls -lR </span><br><br>What directories do you see?<br><br># Issue the following Linux command: <span style=INVESTIGATION 2"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: USING THE LINUX SHELL courier;">tree </ ONLINE ASSIGNMENTS 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;">~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>
<span styletable align="colorright"><tr valign="top"><td>[[Image:blue;fontnano-weighttext-editor-1.png|thumb|right|250px|The '''Nano Text Editor''' is Easy to Operate for Novice Users.]]</td><td>[[Image:bold">command argument1 argument2 .vi-text-editor-1.png|thumb|right|300px|The '''vi Text Editor''', although taking longer to master, has outstanding features and allow the user to be more productive with editing text files. ]]</td></tr></spantable><br>Since IT students will be working in the Unix / Linux command line environment, it is useful to learn a least two common command-line '''text editors'''.
The two most readily-available command line text editors in Linux are '''Nano''' and '''vi'''.<br>The Nano text editor would seem like an easier-to-use text editor, but vi (although taking longer to learn)<br>has outstanding features and allow the user to be more productive with editing text files.
<br><br>
You will now learn basic editing skills using the '''Nano''' text editor including '''creating''', '''editing''', and '''saving''' text files.
<br><br>
'''Perform the Following Steps:'''
# Make certain that you are logged into located in your Matrix accounthome directory.<br><br>[[Image:directory-structure-10.png|right|150px|thumb|]]# '''Create''' the following directory structure (displayed on the right side) by issuing a '''single Linux command'''<br>(You should know how to do this from the previous INVESTIGATION).<br><br># Issue a Linux command to check that you correctly created those directories.<br><br># Issue the following Linux commandto edit a text file called '''mytext.txt''' in the '''linux/practice''' directory: <br><span style="color:blue;font-weight:bold;font-family:courier;">man mannano textedit/practice/mytext.txt</span><br>How many volume numbers are contained in the man pages (like <br>'''executable commands/programsNOTE:''', When using the '''gamesNano'''text editor, or you are placed in '''system administrator commandsINPUT''')?mode, so you can enter text immediately.<br><br>[[Image:nano-text-editor-2.png|right|400px|thumb|Enter the following text that appears in this diagram.]]# Press Enter the lines shown in the other diagram of the letter <span style="color:blue;font-weight:bold">q</span> to exit nano text editor on the man commandright side.<br><br># Issue the Linux command to get help with the command: '''lsNOTE:'''Refer to the table below for a list of<br><br>common '''NOTE:Nano''' You can use the following short-cut keys within the man command to <br>help navigate throughout this utility to get help with the ls command (refer to table below)navigation & editing commands:<br><br><table cellpadding="35"><tr><th style="border-bottom: 1px solid black;">Keyboard ShortcutKey(s)</th><th style="border-bottom: 1px solid black;">Purpose</th></tr><trvalign="top"><tdstyle="font-family:courier">'''<ctrl><SPACEBAR>''',<br>'''ENTER<esc><6>'''</td><td>Move down forward/backward one lineword</td></tr><trvalign="top"><tdstyle="font-family:courier">'''<ctrl><a>''',<br>'''SPACEBAR<ctrl><e>'''</td><td>Move one screen downto beginning/end of line</td></tr><tr><tdstyle="font-family:courier">'''<ctrl><fk>'''</td><td>Move one screen upCut line</td></tr><tr><tdstyle="font-family:courier">'''/pattern/<esc>6'''</td><td>Search for PatternCopy Line</td></tr><tr><tdstyle="font-family:courier">'''q<ctrl><u>'''</td><td>quit man utilityPaste Cut/Copied Text</td></tr></tabletr><brtd style="font-family:courier"># Navigate through the man utility for the '''ls<ctrl><g>''' Linux command and note the option letters that correspond to the following:<br/td><ultd>Display help screen (ctrl-x to exit help screen)<li/td>Include directory entries whose names begin with a dot</litr><litr>List in long format</litd style="font-family:courier"><li>Recursively list subdirectories encountered'''<ctrl><x>'''</litd><litd>Sort files by sizeSave editing changes and exit</li><litd>Display a slash (`/') immediately after each pathname that is a directory</litr></ultable><br># Exit Referring to the man utility table above, practice navigating and editing your entered lines for the ls commandpractice.<br><br># Issue the ls command for each of those option letters you wrote down to see how this command differs for each option.<br><br>NOTE: The To '''man''' utility can be used with the save'''your editing session, press: <span style="color:blue;font-weight:bold;font-k''' option to help list Linux commands that match a text pattern that is contained within the help screen for a Linux command.family:courier;"><ctrl>x</span><br><br># Although we You will not be learning about pipeline commands (using prompted to modify your file: type the | character) until later, try issuing the following pipeline command: letter <span style="font-family:courier;color:blue;font-weight:bold">man -k copy | grep 8y</span><br>How this this pipeline command make it easier to obtain information regarding man command?for '''yes'''.<br><br># If you wish to change your passwordThe name of the file will be displayed, you can change it by issuing the command: Press <span style="color:blue;font-weight:bold;font-family:courier;">passwdENTER</span>.to save editing changes for that file name.<br>What option <br>'''NOTE:''' This prompt for the passwd command can be used file name allows you to change user info (such as the name)?of the file if you wish.<br>By pressing '''Hint:ENTER''' use , it will accept the manpages for default filename.<br><br># Perform some more editing operations based on the passwd commandediting chart above.<br><br># '''NOTE:Save''' You are NOT required to change your Matrix password for this tutorial. The Matrix server is "synched" with the my.senecacollege.ca server, so it is better to have editing session and '''exit''' your Matrix password changed at the same time that you change your myseneca passwordtext editor.<br><br>
===Part 2: Creating Text Files Using The vi Text Editor===[[Image:vi-screen.png|right|300px|thumb|Using the '''Command Line Editingvi'''text editor.]]You will now learn basic editing skills using the '''vi''' ('''vim''') text editor including<br>'''creating''', '''editing''', and '''saving''' text files.
'''Perform the Following Steps:'''
# Type Make certain that you are located in your home directory.<br><br># Issue the following Linux command, but DON’T press to edit a text file called '''othertext.txt''' in the ENTER key'''linux/practice''' directory: <br><span style="color:blue;font-weight:bold;font-family:courier;">cd vi textedit/binpractice/othertext.txt</span><br><br>'''NOTE:''' When using the '''vi''' text editor, you are placed in '''COMMAND''' mode,<br>so you need to issue a command to switch to ''INPUT'' mode.<br><br>[[Image:vi-text-editor-a.png|right|200px|thumb|Enter the following text that appears in this diagram.]]# Press Type the following key to enter ''INPUT'' mode: <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-ai</span> key combination<br><br>You should notice you are in ''INSERT'' mode by seeing the notification '''-- INSERT --'''<br>at the bottom left-hand side of the application screen.<br><br># Enter the line shown in the other diagram of the vi text editor on the right side. What happens?<br><br># Press While on the first line, press the following key to enter ''COMMAND'' mode: <span style="color:blue;font-weight:bold;font-family:courier;">alt-FESC</span> key combination <br><br>You should see the ''-- INSERT --'' notification disappear indicating that you are in ''COMMAND'' mode.<br><br>'''NOTE:''' Refer to the table below for a list of<br>the most common '''vi''' (ESC+F for Mac OSx'''vim'''). What happens?navigation & editing commands:<br><br># Press the <span table cellpadding="5"><tr><th style="border-bottom: 1px solid black;">Key(s)</th><th style="colorborder-bottom:blue1px solid black;">Purpose</th></tr><tr><td style="font-weightfamily:boldcourier">ctrl'''i'''</td><td>Enter '''INPUT''' mode</td></tr><tr><td style="font-wfamily:courier">'''<esc>'''</td><td>Return to '''COMMAND''' MODE</td></spantr><tr><td style="font-family:courier"> shortcut. What happens?'''x'''<br/td><brtd># Type Delete text to the following commandright in COMMAND mode</td></tr><tr><td style="font-family:courier">'''W'''</td><td>Move forward one word in COMMAND mode</td></tr><tr><td style="font-family:courier">'''B'''</td><td>Move back one word in COMMAND mode</td></tr><tr><td style="font-family: courier">'''dd'''</td><td>Cut line in COMMAND mode</td></tr><span tr><td style="colorfont-family:blue;courier">'''yy'''</td><td>Copy Line in COMMAND mode</td></tr><tr><td style="font-weightfamily:boldcourier">ls'''p / P'''</td><td>Paste Cut/spanCopied Text below/above line in COMMAND mode</td><br/tr><brtr># Press the <span td style="colorfont-family:blue;courier">'''u'''</td><td>Undo previous editing command</td></tr><tr><td style="font-weightfamily:boldcourier">ctrl''':help'''</td><td>Display help screen in COMMAND mode</td></tr><tr><td style="font-efamily:courier">''':x'''</spantd><td> key combination Save editing changes and press exit (in COMMAND mode)</td></tr><tr><span td style="colorfont-family:courier">''':blue;w name'''</td><td>Save editing changes to "name" in COMMAND mode</td></tr><tr><td style="font-weightfamily:boldcourier">ENTER''':q!'''</td><td>Abort editing session and exit (in COMMAND mode)</td></tr></spantable><br>Once you can get used to working in INPUT and COMMAND mode, it is easier to perform<br># Press the up arrow key. What happens?text editing operations in '''vi''' via ''COMMAND'' mode as opposed to nano!<br><br># Press Type the following keys to <u>copy</u> the current line: <span style="color:blue;font-weight:bold;font-family:courier;">ctrl-uyy</span> key combination. What happens?<br><br># Press Type the following key to <u>paste</u> the copied line: <span style="color:blue;font-weight:bold;font-family:courier;">up arrowp</span> key combination, and see what happens when <br><br>What did you press notice?<br><br># Type the following keys: <span style="color:blue;font-weight:bold;font-family:courier;">BACKSPACEu</span> , <br><br>What did you notice?<br><br># Type the following keys: <span style="color:blue;font-weight:bold;font-family:courier;"><ctrl><BACKSPACE>3p</span> <br><br>What did you notice?<br><br>[[Image:vi-text-editor-b.png|right|200px|thumb|Use a combination of '''arrow''' keys and the '''w''' and '''b''' keys while in COMMAND mode to change the correct words for the '''third''' and '''fourth''' lines.]]# Use the up or down '''arrow''' keys to move to the second line.<br><br># Type either the '''w''' and/or '''b''' keys to move the cursor to the beginning of the word: '''first'''.<br><br># Type the '''x''' keys to remove the word called '''first'''.<br><br># Type the '''i''' key to enter INSERT mode.<br><br># Type the word: '''second'''<br><br># Press the '''ESC''' key to enter COMMAND mode.<br><br># Repeat steps '''11''' to '''16''' to change the words for line number for lines '''3''' and '''4'''.<br><br># Move to the 4th line (i.e. last line).<br><br># Type the following keys: <span style="color:blue;font-weight:bold;font-family:courier;"><ctrl><h>dd</span><br><br>What did you notice?<br><br>Let's save editing changes and exit the vi text editor. Why is it important to know those series of key combinations?<br><br># Press Type the following keys: <span style="color:blue;font-weight:bold;font-family:courier;">ctrl:x</span> and press '''ENTER'''<br><br>What did you notice?<br><br># 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</spanu> key combination that you run this online tutorial in your Matrix account to learn how to clear create and edit text files with the linevi text editor.<br><br># Press Issue the following to run the vi online tutorial:<br><span style="color:blue;font-weight:bold;font-family:courier;">ctrl/home/murray.saul/vi-ltutorial<br></spanbr># 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> key combinationand will provide you with "'''hands-on'''" practice using the vi text editor. What happens? What As far as this author is aware,<br>there is NO "hands-on" tutorial for the advantage of using nano text editor in this key combination then issuing particular format.<br><br># When you have completed that section, you will be returned to the main menu.<br>If you want to get extra practice, you can select the menu item labelled "'''clearREVIEW EXERCISE''' command?".<br><br># When you want to exit the tutorial, select the menu option to exit the tutorial.<br><br>
= LINUX PRACTICE QUESTIONS =
simulate a quiz:
https://ict.senecacollege.ca/~murray.saul/uli101/uli101_week1_practiceuli101_week2_practice.docx
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:'''
[[Category:ULI101]]