While upgrading a third-party library on a production server, you copy the new file to /usr/local/lib/libexample.so.4. The existing symbolic link /usr/local/lib/libexample.so currently points to libexample.so.3. You need to update the symbolic link to point to the new library file. Which single command will replace the existing link to point to the new file without requiring an interactive prompt?
A symbolic link is created with the syntax ln -s target linkname. To update an existing symbolic link, the target pathname (/usr/local/lib/libexample.so.4) must be specified first, followed by the link name (/usr/local/lib/libexample.so). By default, ln will not overwrite an existing file or link. The -f (force) option is required to remove the existing destination before creating the new link, which avoids an interactive prompt or an error. Therefore, ln -sf /usr/local/lib/libexample.so.4 /usr/local/lib/libexample.so is the only command that correctly updates the symbolic link in a single step. The variant that omits -s would attempt to create a hard link, the variant that omits -f would fail because the link already exists, and the command with the operands reversed would create a link in the wrong direction.
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 a symbolic link in Linux?
Open an interactive chat with Bash
Why is the `-f` option important when updating a symbolic link?
Open an interactive chat with Bash
What happens if `-s` is omitted when using the `ln` command?
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 .