To remove a directory, it must be empty of all files. After all the files have been removed, you return to the home directory or if it is a subdirectory, the directory right above the directory to be deleted.