010-160 · Question #78
What is true about links in a Linux file system?
The correct answer is D. A symbolic link can point to a file on another file system. A symbolic link is a special file that stores a path reference and can cross file system boundaries, unlike hard links which are bound to a single file system.
Question
Options
- AA symbolic link can only point to a file and not to a directory.
- BA hard link can only point to a directory and never to a file.
- CWhen the target of the symbolic link is moved, the link is automatically updated.
- DA symbolic link can point to a file on another file system.
- EOnly the root user can create hard links.
How the community answered
(21 responses)- A14% (3)
- B5% (1)
- C5% (1)
- D76% (16)
Why each option
A symbolic link is a special file that stores a path reference and can cross file system boundaries, unlike hard links which are bound to a single file system.
Symbolic links can point to both files and directories; for example, /run/lock is commonly a symlink to a directory.
Hard links reference an inode directly and can only point to regular files, never to directories (with rare root-level exceptions), which is the opposite of what this choice states.
When the target of a symbolic link is moved or renamed, the link is not updated automatically - it becomes a dangling (broken) symlink pointing to the old path.
Symbolic links store a path string rather than an inode reference, so they can point to targets on entirely different file systems or partitions without restriction.
Any user with appropriate permissions in a directory can create hard links to files they own; root is not required.
Concept tested: Symbolic links vs hard links cross-filesystem behavior
Source: https://www.man7.org/linux/man-pages/man7/symlink.7.html
Topics
Community Discussion
No community discussion yet for this question.