Developing Applications and Automating Workflows Using Cisco Platforms (DEVASC) — Question 87
After a project is migrated to a new codebase, the `old_project` directory must be deleted. This directory has multiple read-only flies, and it must be deleted recursively without prompting for confirmation. Which Bash command must be used?
Answer options
- A. rmdir -p old_project
- B. rm -rf old_project
- C. rm -r old_project
- D. rmdir old_project
Correct answer: B
Explanation
The command 'rm -rf old_project' is the correct choice because it forcefully removes the directory and its contents, including read-only files, without asking for confirmation. The 'rmdir' command is only able to remove empty directories, making options A and D incorrect, and while 'rm -r old_project' would remove the directory recursively, it would prompt for confirmation in the case of read-only files, making option C unsuitable.