Reply To: How to delete a directory in the Linux terminal?

LearnTips LearnTips How to delete a directory in the Linux terminal? Reply To: How to delete a directory in the Linux terminal?

#3696
Santhosh Kumar D
Keymaster
@santhosh

If a subdirectory or a file within the main directory is write-protected, you will be prompted to confirm the deletion.

To force delete a directory containing subdirectories and files without being prompted, you need to use the rm -rf command followed by the directory name.

rm -rf directory