How do you create a symbolic link named latest to a file /var/log/app/2024-01.log?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

How do you create a symbolic link named latest to a file /var/log/app/2024-01.log?

Explanation:
A symbolic link is created with the syntax: ln -s TARGET LINK_NAME. The link name is what you want the pointer to be called, and the target is the file it points to. For this case, you want a link named latest that points to /var/log/app/2024-01.log. If you’re in the directory where you want the link, the correct command is: ln -s /var/log/app/2024-01.log latest. If you prefer the link to be created in a specific directory, give the full path for the link name, e.g. ln -s /var/log/app/2024-01.log /var/log/app/latest. Also note that the command uses lowercase ln; using an uppercase L (Ln) won’t work.

A symbolic link is created with the syntax: ln -s TARGET LINK_NAME. The link name is what you want the pointer to be called, and the target is the file it points to. For this case, you want a link named latest that points to /var/log/app/2024-01.log. If you’re in the directory where you want the link, the correct command is: ln -s /var/log/app/2024-01.log latest. If you prefer the link to be created in a specific directory, give the full path for the link name, e.g. ln -s /var/log/app/2024-01.log /var/log/app/latest. Also note that the command uses lowercase ln; using an uppercase L (Ln) won’t work.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy