shortcut is a symbolic link to target.txt.
Delete target.txt but leave shortcut itself in place.
What is the resulting state?
A symbolic link stores a target path. Removing the target leaves the link entry behind, but its path can no longer be resolved.
Detailed explanation
Incorrect. Removing a target does not automatically remove a symbolic link.
Incorrect. Removing a target does not automatically remove a symbolic link.
Incorrect. The link does not become a regular file.
Incorrect. The link does not become a regular file.
Incorrect. There is no inode sharing that would preserve the old data.
Incorrect. There is no inode sharing that would preserve the old data.
Correct. shortcut remains as a dangling symbolic link.
Correct. shortcut remains as a dangling symbolic link.
Try it yourself
An example you can run in a temporary verification environment.
readlink shortcutExpected result
リンクに格納されたtarget.txtというパス。参照先がなくても文字列は読めるKey points
- The link itself remains
- The target path is absent
- It becomes a dangling link
Notes
- Environment: GNU coreutils 9.x/Linux
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.