QuestionQ4

Basic Unix Skills

While creating a symbolic link, an error reports that the target already exists. Which statement is true?

  • A ln can not override an existing target so the target must be manually removed.
  • B ln can override the target, but only if it is a file.
  • C ln can override the target, but only if it is a directory.
  • D ln can override the target, whether it is a file or a directory.
  • E ln can not override an existing symbolic link.
Explanation

The ln command normally does not replace an existing destination. Its -f (--force) option removes an existing destination file before creating the link, but an existing directory is treated as a directory destination rather than overwritten.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!