Multiple choice unix

Which command is used to remove a directory?

  1. rd

  2. rmdir

  3. dldir

  4. rdir

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The rmdir (remove directory) command is used to delete empty directories. While rd exists in some other operating systems (like Windows), rmdir is the standard Linux/Unix command.

AI explanation

In Unix/Linux, rmdir is the command that removes an (empty) directory. 'rd' is the DOS/Windows equivalent, not Unix; 'dldir' and 'rdir' aren't real commands at all. So rmdir is the only valid choice for removing a directory in a Unix shell.