Upon creating a soft link, what happens if the original file is deleted?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

When a soft link, also known as a symbolic link, is created, it acts as a pointer or reference to the original file. If the original file is deleted, the link does not have a valid target to point to. As a result, the soft link becomes "broken" because it no longer points to an existing file. This means that any attempt to access or use the soft link will result in an error indicating that the target file can’t be found.

In contrast, when a hard link is used, both the original file and the hard link reference the same inode on the disk. Thus, if the original file is deleted, the hard link remains functional as long as it points to the inode that still exists. Soft links, however, rely on the existence of the original file, and without it, they lose their functionality. Consequently, the correct understanding is that the soft link becomes broken when the original file is deleted.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy