Removing a directory in Linux is harder than you think, and it's not uncommon to get errors that looks like this:
folder: Directory not empty folder: is a directory
The confusion comes because
rmdir cannot be used to delete a directory with files or folders inside of it.
To remove a directory on linux, which is not empty, pass the
-r flag to
-r means recursive, so it deletes everything in a folder, including the folder itself. Replace 'folder' below with your folder's name or location.
rm -r folder
If you want to remove multiple directories on linux, and they are not empty, simply separate the folder names with a space, and use
rm -r folder1 folder2 folder3
If you want to remove a directory on linux, and your directory is empty, with no folders or files in it, then use rmdir: