Skip to main content
  1. Public practice questions
  2. AZ-104 Practice Exams | Azure Administrator Associate
  3. AZ-104 Practice Exam 5

Question 7 — AZ-104 Practice Exam 5

You’re asked to safely remove a directory called orders that contains files and subdirectories. Which command best meets the requirement? (Select one answer)

  1. rmdir orders

  2. rm -r orders

  3. rm orders

  4. cd orders

Correct answers

  1. rm -r orders

Explanations

Correct:
rm -r orders: Recursively deletes orders and its contents.

Wrong:
rmdir orders: Works only if directory is empty.
rm orders: Works for files, not directories.
cd orders: Changes into the directory, doesn’t delete it.