To remove an empty directory named 'Downloads', which command would you use?

Prepare for the LPI Linux Essentials 010-160 Test. Study with flashcards and multiple choice questions, each question offers hints and explanations. Get ready to ace your exam!

Using the command to remove an empty directory named 'Downloads' is appropriate because the rmdir command is specifically designed for this purpose. The command rmdir stands for "remove directory," and it will only succeed if the directory is empty. It is a safety mechanism to ensure that users do not accidentally delete directories that contain files or other directories.

When trying to remove an empty directory, rmdir is the most straightforward and correct choice. It will provide feedback if the directory is not empty or doesn't exist, which helps in managing files and directories effectively on the system.

In contrast, other options are structured for different purposes. The rm command is generally used to remove files and directories but requires additional flags for directories, such as -r for recursive removal. The del command is not a standard command in Unix/Linux systems; it is associated with DOS/Windows. Therefore, rmdir is optimal and correct for the task of removing an empty directory like 'Downloads'.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy