To remove an existing directory from your working directory, move to the target directory, delete all its files, move back to the parent directory, and then use the rmdir command:
cd /u/useless
pwd
/u/useless
rm -i *
cd ..
rmdir useless
The -i switch forces rm to prompt for confirmation before removing
a file.
If you try to remove a directory that is not empty, you will see a
warning displayed.
You may use the following shorter method instead of the above:
rm /u/useless/*
rmdir /u/useless
or:
rm -r /u/useless
The -r switch removes all files recursively from the directory tree.
Note that these do not delete the hidden files such as .login. For that issue the command
rm /u/useless/.*