Linux

The command,

{code}

rmdir dir1

{/code}

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

{code}

rm -rf dir1

{/code}