On Directory Not Empty?

If the directory is not empty or you do not have permission to delete it, you will see an error message. To remove a directory that is not empty, use the rm command with the -r option for recursive deletion. ... If you don't use this command very cautiously, you risk deleting all or most of your files.

What does it mean directory is not empty?

What is error 0x80070091 The directory is not empty? It mainly occurs when you try to delete a folder from an external hard disk or SD card or pen drive, but it can also happen when deleting a file from the system drive.

How do I remove a non empty directory in Linux?

There are two commands that one can use to delete non empty directories in Linux operating system:
  1. rmdir command – Delete directory only if it is empty.
  2. rm command – Remove directory and all files even if it is NOT empty by passing the -r to the rm to remove a directory that is not empty.
Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.