Refer to /srv/archive from /home/alice/archive.
A regular user should create the link with the normal ln command.
Which method is appropriate?
Use a symbolic link for ordinary directory references. Directory hard links are normally prohibited to prevent filesystem-tree cycles.
Detailed explanation
Incorrect. A directory hard link is normally not permitted and can create cycles.
Incorrect. A directory hard link is normally not permitted and can create cycles.
Incorrect. cp does not share an inode for a directory tree in this way.
Incorrect. cp does not share an inode for a directory tree in this way.
Correct. ln -s creates the normal symbolic reference to a directory.
Correct. ln -s creates the normal symbolic reference to a directory.
Incorrect. Symbolic links are specifically usable for directories.
Incorrect. Symbolic links are specifically usable for directories.
Try it yourself
An example you can run in a temporary verification environment.
ln -s /srv/archive /home/alice/archiveExpected result
書き込み権限とパスが有効ならディレクトリを指すsymlinkを作成するKey points
- Directory hard links are normally disallowed
- Symbolic links can target directories
- Use -s
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.