A systems administrator needs to provide access to a configuration file, /etc/app/config.conf, from a user's home directory located at /home/user/settings.conf. The /home directory is mounted on a separate filesystem from the root (/) filesystem. A key requirement is that if the original configuration file is deleted, the link in the user's home directory must become invalid to prevent an application from using a stale or incorrect path. Which of the following commands will meet all these requirements?
The correct command is ln -s /etc/app/config.conf /home/user/settings.conf. This creates a symbolic link (also known as a soft link). Symbolic links are necessary for creating links that span across different filesystems. They function as a pointer to the original file's path. If the original file is deleted, the symbolic link will remain but will become a "dangling" or "broken" link, which fulfills the requirement that the link becomes invalid.
The command ln /etc/app/config.conf /home/user/settings.conf attempts to create a hard link. Hard links cannot be created across different filesystems because they point to the same inode, and inodes are unique within a specific filesystem. This command would fail.
The command ln -s /home/user/settings.conf /etc/app/config.conf has the source and destination arguments reversed. This would attempt to create a symbolic link at /etc/app/config.conf that points to /home/user/settings.conf.
The command cp -l /etc/app/config.conf /home/user/settings.conf is another method for creating a hard link. The cp -l command links files instead of copying them. Just like the standard ln command for hard links, it cannot operate across different filesystems and would fail.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the difference between a symbolic link and a hard link in Linux?
Open an interactive chat with Bash
Why are hard links restricted from spanning across different filesystems?
Open an interactive chat with Bash
What does the term 'dangling symbolic link' mean in Linux?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .