A system administrator creates a symbolic link named /var/data/sym_logs that points to the /opt/application/logs directory. After creation, the administrator navigates into the symbolic link directory using the command cd /var/data/sym_logs. Which of the following statements correctly describes the output of the pwd and pwd -P commands when executed from this location?
The pwd command will display /var/data/sym_logs, and the pwd -P command will display /opt/application/logs.
Both pwd and pwd -P will display /opt/application/logs.
Both pwd and pwd -P will display /var/data/sym_logs.
The pwd command will display /opt/application/logs, and the pwd -P command will display /var/data/sym_logs.
The pwd command, which stands for 'print working directory', displays the current location in the filesystem. By default, or when using the -L (Logical) flag, pwd will show the path used to get to the current directory, including any symbolic links. In this scenario, the user changed directory using /var/data/sym_logs, so pwd will display that path. The -P (Physical) flag tells pwd to resolve all symbolic links and display the actual physical path. Therefore, pwd -P will show /opt/application/logs, which is the directory the symbolic link points to.
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?
Open an interactive chat with Bash
What does the `pwd -P` command do, and how is it different from `pwd`?
Open an interactive chat with Bash
How can you identify if a file is a symbolic link?
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 .