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.
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)- A2% (1)
- B2% (1)
- D6% (3)
- E90% (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.
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.
The `del` command is not a standard Linux utility for removing files; it is typically found in DOS/Windows environments.
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.
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
Community Discussion
No community discussion yet for this question.