Configure Links in Linux
This Configure Links in Linux IT Pro Challenge helps learners understand the difference between hard links and symbolic links and how to manage each. They will also learn how to search.
After taking this Configure Links in Linux IT Pro Challenge lab, learners will understand how to...
In this lab, the learner is the system administrator who is responsible for a Linux server, and they need to configure both hard and symbolic links between files and then find any broken symbolic links.
You will find Linux configuration files inside the /var directory that are linked. You will learn how to create and examine links using In and find, and then you will edit as well as delete the files using various Linux file management commands.
You will also learn how to create files and directories using Linux commands, the difference between hard and symbolic links, and how to manipulate files and their contents using links.
Create a linked file
To begin, you will create two directories (one for original data and one for linked data). In one directory, you will create a file that contains text. In the second directory, you’re going to create a text file that contains a hard link to the first file that you created. Then you will see how you can change the content of the file by both modifying the file itself and modifying the hard link to the file.
In Windows, a hard link is one that is only valid within the same file system. A hard link creates a mirror copy of the file. This allows you to still view the file that is linked even if the file is deleted. You can create a hard link to a file, but not to a directory.
Create a symbolic link
Unlike a hard link, symbolic links (sometimes also called soft links) only contain the path to the actual source file. Symbolic links can cross file system boundaries, and they allow you to link both files and directories. If you delete a symbolic link, you can no longer view the contents of the source file that was linked.
In this part of the lab, you will learn how to create a symbolic link and how they work. After you create the symbolic link to the file, you will use that link to update the contents of the file.
Delete the file in /LinkedData and check the symbolic link
Finally, you will delete the file that you created the symbolic link to and then check that link so that you understand that unlike hard links to files, symbolic links don’t contain a copy of the file. Once the file is gone from the source, you won’t be able to view it through a symbolic link.
By taking this virtual lab, you will learn the difference between a hard link and a symbolic link. You will understand how to manage files using both hard and symbolic links and how to search for symbolic links.