Vidyalelo
Computer Science · Q6

UNIX

Engineering and GATE · Computer Science · question 6

Q6

Which command is used to remove a directory?

A.
rd
B.
rmdir
Answer
C.
dldir
D.
rdir
E.
None of the above

Answer: Option B

Solution

Answer: Option B
Solution:
In Unix, the rmdir command is used to remove or delete a directory. It is specifically designed to remove directories and will only work if the directory is empty. If the directory contains any files or subdirectories, rmdir will not remove it and will generate an error message.
So, rmdir is the correct command to remove a directory.