Open main menu

CDOT Wiki β

Changes

Tutorial8: Links / Process Management

187 bytes added, 20:35, 4 September 2023
no edit summary
{{Admon/caution|DO NOT USE THIS VERSION OF THE LAB. This page will no longer be updated.|'''New version here:''' https://seneca-ictoer.github.io/ULI101/A-Tutorials/tutorial8<br />'''Andrew's students please go here:''' http://wiki.littlesvr.ca/wiki/OPS145_Lab_7}}
=LINKING FILES / MANAGING PROCESSES=
<br>
|- valign="top" style="padding-left:15px;"
|colspan="2" |Course Notes'''Slides:'''<ul><li>Week 8 Lecture 1 Notes:<br>[https://ictwiki.cdot.senecacollege.ca/~murrayuli101/slides/ULI101-8.1.pdf PDF] | [https://wiki.saulcdot.senecacollege.ca/uli101/slides/ULI101-Week88.1.pptx PPTX]</li><li>Week 8 Lecture 2 Notes:<br> [https://wiki.cdot.senecacollege.ca/uli101/slides/ULI101-8.2.pdf PDF] | [https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101slides/ULI101-Week88.2.pptx PPTX]<br></li></ul>
| style="padding-left:15px;" |'''Links:'''
* [http://www.linfo.org/hard_link.html#:~:text=A%20hard%20link%20is%20merely,created%20to%20other%20hard%20links. Hard Links]
* [https://www.computerhope.com/jargon/s/symblink.htm#:~:text=Alternatively%20referred%20to%20as%20a,or%20directory%20using%20its%20path.&text=In%20Linux%20and%20Unix%20symbolic,created%20using%20the%20mklink%20command. Symbolic Links]<br>
'''Managing Processes:'''
* [https://en.wikipedia.org/wiki/Inode inode]
* [https://opensource.com/article/18/9/linux-commands-process-management Manipulating Processes]
| style="padding-left:15px;"|'''Linux Commands:'''
* [http://man7.org/linux/man-pages/man1/ln.1.html ln]
* [http://man7.org/linux/man-pages/man1/ps.1.html ps]
* [https://mediatemple.net/community/products/dv/204404624/using-the-history-command history]
|colspan="1" style="padding-left:15px;" width="30%"|'''Brauer Instructional Videos:'''<ul><li>[https://www.youtube.com/watch?v=tZ94-qH9unM&list=PLU1b1f-2Oe90TuYfifnWulINjMv_Wr16N&index=9 Inodes and Links]</li><li>[https://www.youtube.com/watch?v=q93POTgH-aQ&list=PLU1b1f-2Oe90TuYfifnWulINjMv_Wr16N&index=7 Processes and Jobs]</li></ul>
|}
=INVESTIGATION 1: LINKING FILES=
<span style="color:red;">'''ATTENTION''': Depending on your ULI101 instructor, you may This online tutorial will be required to complete this tutorial for '''marks''' in this course.<br>Please refer to your instructor's course notes and lecture notes regarding evaluation for this course.<br><br>The due date for successfully completing this tutorial (i.e. '''tutorial 8''') is be completed by '''Friday in week 9 by midnight''' next week (i.e. to obtain a grade of '''Week 82%''').<br>If your instructor has NOT assigned marks for completing towards this tutorial, you can perform it for '''practice'''.course</span><br><br>
In this investigation, you will learn how to create '''hard links''' and '''symbolic links''' on your Matrix account,<br>and observe the <u>advantages</u> and <u>limitations</u> of using both types of links.
# Issue the following Linux command to create a hard-linked file in your '''home''' directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">ln ~/links/data-file.txt ~/data-file.hard.lnk<br><br>
# Issue the following Linux command to compare all file's ''i-node'' numbers:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -li ~/links/data-file.txt ~/links/data-file.hard.lnk ~/data-file.hard.lnk</span><br><br>What do you notice about all of those file's ''i-node'' numbers?<br><br>
# Issue the following Linux command to check that you created those hard links: <br><span style="color:blue;font-weight:bold;font-family:courier;">~uli101/myscripts/week8-check-1</span><br><br>If you encounter errors, then view the feedback to make corrections, and then re-run the checking script.<br>If you receive a congratulation message that there are no errors, then proceed with this tutorial.<br><br>
# Issue the following Linux command to remove the '''~/links''' directory and its contents: <br><span style="color:blue;font-weight:bold;font-family:courier;">rm -rf ~/links</span><br><br>
# Issue a Linux command to confirm that the '''~/links''' directory has been removed.<br><br>
# Issue the following Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">ls -l ~/text-file.sym.lnk</span><br><br>This output indicates a "'''broken link'''" and indicates this is not an effective method of backing up files.<br><br>
# Issue a command to delete the <span style="font-weight:bold;font-family:courier;">~/text-file.sym.lnk</span> file which is a ''broken link''.<br><br>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">ln -s ~murrayjason.saulcarman/myscripts checking-scriptsexample t8example</span><br><br>[[Image:symbolic-link-inode2.png|thumb|right|500px|'''Symbolic links''' can be used to point to '''directories''' as well as regular files. Symbolic links can also point to files on '''other''' Unix/Linux filesystems.]]# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -ld checking-scriptst8example</span><br><br>What do you notice? Symbolic links are good for creating "short-cuts" to <u>both</u> '''regular files''' and '''directories'''.
# Type the following: <span style="color:blue;font-family:courier;font-weight:bold">!unalias</span> and press <span style="color:blue;font-family:courier;font-weight:bold">ENTER</span><br><br>What happened?<br><br>
# Issue the following Linux command: <span style="color:blue;font-family:courier;font-weight:bold">history | grep "lh"</span><br><br>What happened?<br><br>
# After you complete the Review Questions sections to get additional practice, then work on your<br>'''online assignment 2''' and complete '''section4''' labelled: '''Linking files and directories'''.<br><br>
= LINUX PRACTICE QUESTIONS =
simulate a quiz:
https://ictwiki.cdot.senecacollege.ca/~murray.saululi101/uli101files/uli101_week8_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).
# Aliases / History:<ol type="a"><li>Write a linux command to create an '''alias''' called '''ld''' that issues the command: '''ls -ld'''</li><li>Write a linux command to unset the '''alias''' created in the previous question.</li><li>Issue a Linux command to list '''history''' of commands that match the pattern called '''touch'''.</li></ol><br>
# Create a '''table''' listing each Linux command, useful options and command purpose for the following Linux commands:<br>'''ln''' , '''ps''' , '''top''' , '''fg''' , '''bg''' , '''jobs''' , '''kill''' , '''alias''' , '''unalias''' , '''history'''
 
 
_________________________________________________________________________________
 
Author: Murray Saul
 
License: LGPL version 3
Link: https://www.gnu.org/licenses/lgpl.html
 
_________________________________________________________________________________
 
[[Category:ULI101]]