Ubuntu Linux Directory not empty

If you are getting the Directory not empty error while remoing a directory in Ubuntu Linux then the solution is to empty the directory first which you can do via following command:

rm -r /yourpath/yoursubpath/your-directory/

You can run the rmdir command now to delete the directory:

rmdir -r /yourpath/yoursubpath/your-directory