Introduction
In this challenge, you will explore symbolic links (soft links) in a Linux system. You'll create a symbolic link, modify its content, and observe how it behaves when the target file is removed.
Environment
LabEx uses Red Hat Universal Base Image 9 (UBI9) to simulate the exam environment. It may not be identical to the actual RHCSA exam environment, but it provides a good representation of the tasks you'll encounter.
There are two users in the environment:
labex: A standard user with sudo privileges, password:labex.root: The system administrator, password:redhat.
The challenge features real exam questions, along with explanations, requirements, and automated verification scripts to help you confirm task completion. It effectively simulates the knowledge areas covered in the RHCSA exam.
Create and Manipulate a Symbolic Link
This step involves creating a symbolic link, editing its content, and observing its behavior when the target file is removed.
Tasks
- Create a symbolic link named
soft1in/home/labexpointing to/tmp/hard2. - Edit the content of
soft1. - List the attributes of
soft1. - Remove the target file
hard2. - List the attributes of
soft1again.
Requirements
- Perform all operations as the
labexuser. - Create the symbolic link
soft1in/home/labexdirectory. - The target file
hard2should be in the/tmpdirectory. - Use
ln -sto create the symbolic link. - Use
echoto add content to the symbolic link. - Use
ls -lto list file attributes. - Use
rmto remove the target file.
Example
After creating the symbolic link and editing its content, you might see output similar to this:
$ ls -l /home/labex/soft1
lrwxrwxrwx 1 labex labex 10 Aug 28 10:00 /home/labex/soft1 -> /tmp/hard2
Summary
In this challenge, you learned how to create and manipulate symbolic links in a Linux system. You created a symbolic link, added content to it, observed its attributes, and experienced how it behaves when the target file is removed. This exercise demonstrates the flexibility of symbolic links and their behavior in different scenarios, which is crucial knowledge for system administration and file management in Linux environments.



