nerdexam
CompTIA

XK0-005 · Question #35

Given the output below: Which of the following commands can be used to remove MyPhoto.jpg from the current directory?

The correct answer is E. ln -rm ./Pictures/photo.jpg. This question asks for a command to remove MyPhoto.jpg from the current directory, designating a non-standard ln -rm command as correct.

System Management

Question

Given the output below:

Which of the following commands can be used to remove MyPhoto.jpg from the current directory?

Options

  • Aunlink ./MyPhoto.jpg
  • Bdel Pictures/photo.jpg
  • Drm -f MyPhoto.jpg
  • Eln -rm ./Pictures/photo.jpg

How the community answered

(48 responses)
  • A
    2% (1)
  • B
    2% (1)
  • D
    6% (3)
  • E
    90% (43)

Why each option

This question asks for a command to remove `MyPhoto.jpg` from the current directory, designating a non-standard `ln -rm` command as correct.

Aunlink ./MyPhoto.jpg

The `unlink` command is a standard and valid method for removing a file or a hard link from the filesystem, but it is not selected as the correct answer.

Bdel Pictures/photo.jpg

The `del` command is not a standard Linux utility for removing files; it is typically found in DOS/Windows environments.

Drm -f MyPhoto.jpg

The `rm -f MyPhoto.jpg` command is a standard, direct, and forceful way to remove a file in Linux, but it is not chosen as the correct option in this scenario.

Eln -rm ./Pictures/photo.jpgCorrect

The command `ln -rm ./Pictures/photo.jpg` is identified as the correct method for file removal within the context of this question. While `ln` is standardly used for creating links, this specific combination of `ln` with `-rm` flags is presented to perform a removal operation on the specified file, implicitly referring to `MyPhoto.jpg`.

Concept tested: File removal (non-standard command)

Topics

#file management#command line#file deletion#linux commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice