The command,
rmdir dir1
will remove the directory dir1 only if it is empty. Else you will get an error message,
rmdir: failed to remove `dir1': Directory not empty
The following command removes the directory and the sub-directories
rm -rf dir1