Which command outputs the target path of a symbolic link?

Study for the OSCP Linux Exam. Use our flashcards and multiple-choice questions to test your skills. Each query comes with detailed hints and explanations to enhance your preparedness. Get ready to conquer the exam!

Multiple Choice

Which command outputs the target path of a symbolic link?

Explanation:
Revealing where a symbolic link points. A symbolic link stores the path to its target, and readlink prints that path exactly as stored in the link, without following it. This makes readlink the clear choice for viewing the destination of a symlink, and you can use readlink -f if you need the fully resolved absolute path. Other commands don’t give the destination directly: ls -l shows a listing that may include the target after an arrow but is not a dedicated path print; cat follows the link to show the contents of the target file; touch simply creates or updates a timestamp on a file.

Revealing where a symbolic link points. A symbolic link stores the path to its target, and readlink prints that path exactly as stored in the link, without following it. This makes readlink the clear choice for viewing the destination of a symlink, and you can use readlink -f if you need the fully resolved absolute path. Other commands don’t give the destination directly: ls -l shows a listing that may include the target after an arrow but is not a dedicated path print; cat follows the link to show the contents of the target file; touch simply creates or updates a timestamp on a file.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy