Multiple choice technology programming languages

How do I remove a file/directory?

  1. removedir

  2. rmdir

  3. rm

  4. None

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

rmdir (remove directory) is specifically designed to delete empty directories. rm can remove both files and directories (with -r flag), but rmdir is the dedicated command for directories and is safer as it only works on empty ones, preventing accidental data loss.