Changes

Jump to: navigation, search

Tutorial8: Links / Process Management

3 bytes removed, 12:00, 25 February 2021
INVESTIGATION 1: LINKING FILES
# Issue the following Linux command to create a directory called '''~/links2''':<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir ~/links2</span><br><br>
# Issue the <span style="font-weight:bold;font-family:courier;">ls</span> command to confirm that the directory called '''~/links2''' exists.<br><br>
# Use a text editor to create a file called: <span style="font-weight:bold;font-family:courier;">~/links2/text-file.txt</span><br><br>
# Enter the following text displayed below:<br><br><span style="font-family:courier;font-weight:bold;">This is line one<br>This is line two<br>This is line three<br><br></span>
# Save your editing session and exit your text editor.<br><br>
# Issue the following Linux command to create the following symbolic link in your '''home''' directory: <br><span style="color:blue;font-weight:bold;font-family:courier;">ln -s ~/links2/text-file.txt ~/text-file.sym.lnk</span><br><br>
# Issue the following Linux command to display ''i-node'' numbers for all of those files:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -li ~/links2/text-file.txt ~/links2/text-file.sym.lnk ~/text-file.sym.lnk</span><br><br>What do you notice? What is the file size of <span style="font-weight:bold;font-family:courier;">~/links2/text-file.txt?</span><br>What pathname do you think this file contains?<br><br>
# Use a text editor to edit the '''symbolic''' link file called: <span style="font-weight:bold;font-family:courier;">~/links2/text-file.sym.lnk</span><br>and add some lines to the bottom of that file.<br><br>
# Save your editing session and exit your text editor.<br><br>
# Issue the following Linux command to view the contents of the '''original''' file:<br><span style="color:blue;font-weight:bold;font-family:courier;">cat ~/links2/text-file.txt</span><br><br>What did you notice? This happened because when you edited the symbolically-linked file,<br>you were redirected (via pathname) to the original file.<br><br>
# Use a text editor to edit the original file called: <span style="font-weight:bold;font-family:courier;">~/links2/text-file.txt</span><br>and add some lines to the bottom of that file.<br><br>
# Save your editing session and exit your text editor.<br><br>
# Issue the following Linux command to view the contents of the '''symbolic''' linked file:<br><span style="color:blue;font-weight:bold;font-family:courier;">cat ~/links2/text-file.sym.lnk</span><br><br>What did you notice? Again, when you view the contents of the symbolically-linked file,<br>you are redirected (via pathname) to the original file.<br><br>
13,420
edits

Navigation menu