Multiple choice technology operating systems

Which command is used to delete all files in the current directory and all its sub-directories?

  1. rm

  2. rm -r

  3. rmdir

  4. del

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

The rm -r (recursive) command deletes all files and subdirectories within a directory tree. Plain rm only deletes files, not directories. rmdir only removes empty directories, not files or non-empty directories. del is a DOS/Windows command, not Unix/Linux.