Open main menu

CDOT Wiki β

Changes

Tutorial8: Links / Process Management

33 bytes added, 08:40, 6 February 2020
INVESTIGATION 1: LINKING FILES
# Use a text editor to create a file called '''~/links/data-file.txt'''<br><br>
# Enter the following text displayed below:<br><br><span style="font-family:courier;font-weight:bold;">This is line 1<br>This is line 2<br>This is line 3<br><br></span>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">ls -li ~/links/data-file.txt</span><br><br>Note View the '''i-node''' number for this file. What does this i-node number represent?<br><br>
# Issue the following Linux command to create the following hard link in the same directory: <br><span style="color:blue;font-weight:bold;font-family:courier;">ln ~/links/data-file.txt ~/links/data-file.hard.lnk<br><br>
# Issue the '''ls -li''' command for the '''~/links''' directory.<br><br>What do you notice about both of these file's i-node numbers?<br><br>
# Issue the following Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">cat ~/links/data-file.hard.lnk</span><br><br>What do you noticed what happened to this original file?<br><br>
# 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 '''ls -i''' command to determine the i-node number for the file called '''~/data-file.hard.lnk'''<br><br>What do you notice about this file's ''i-node'' number?<br><br>
# Make certain you are currently located in your '''home''' directory.<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 to view the contents of your linked file in your '''home''' directory:<br><span style="color:blue;font-weight:bold;font-family:courier;">cat ~/data-file.hard.lnk</span><br><br>What do you notice? What does this tell you about hard links?<br><br>
# Issue the following Linux command to create a directory called '''~/links2''':<br><span style="color:blue;font-weight:bold;font-family:courier;">mkdir ~/linkslinks2</span><br><br>
# Issue the '''ls''' command to confirm that the directory called '''~/links2''' exists.<br><br>
# Use a text editor to create a file called '''~/links2/text-file.txt'''<br><br>
# Change to your '''home''' directory.<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 '''ls -l ''' command for the '''~/text-file.txt.sym.lnk ''' file.<br><br>What do you notice? What is the file size?<br>What pathname do you think this file contains?<br><br>
# Issue the following Linux command:<br><span style="color:blue;font-weight:bold;font-family:courier;">cat ~/text-file.txt.sym.lnk</span><br><br>What did you notice?<br><br>
# Issue the following Linux command to remove the '''~/links2 ''' directory: <br><span style="color:blue;font-weight:bold;font-family:courier;">rm -rf ~/links2</span><br><br># Re-issue the Linux command you performed in '''step #3431'''.<br><br>What happened? Why?<br><br>
# Issue the following Linux command: <br><span style="color:blue;font-weight:bold;font-family:courier;">ls -l ~/text-file.txt.sym.lnk</span><br><br>What do you notice?<br><br>
# Issue the following Linux command: <span style="color:blue;font-weight:bold;font-family:courier;">ln -s ~uli101 linux</span><br><br>
13,420
edits