The project is migrated to a new codebase, the “old_project” directory must be deleted. The directory has multiple read-only files, and it must be deleted recursively without prompting for confirmation. Which bash command must be used?
To delete a directory and all of its contents (including read-only files) recursively without prompting for confirmation, the rm command with the -rf flags should be used.
rm -r: This option tells rm to remove directories and their contents recursively.
rm -f: This option tells rm to force the removal of files, ignoring nonexistent files and never prompting for confirmation.
Therefore, the correct command is rm -rf old_project. This command will recursively remove the old_project directory and all its contents without any confirmation prompts, regardless of file permissions.
References: Cisco DevNet Associate Certification Guide, Chapter on Linux and Bash Commands.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit