How to remove non-empty directory?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 31 2025
0124

To remove a non-empty directory, you can use the following command:

rm -r directory-name

Replace directory-name with the name of the directory you want to remove. The -r option stands for "recursive," which means it will delete the directory along with all its contents, including files and subdirectories.

Caution: Be careful when using this command, as it will permanently delete the directory and its contents without any confirmation.

0 Comments

no data
Be the first to share your comment!