How do you delete a folder that contains spaces?

So I finally got my Ubuntu box up and running, ran the LAMP install, and successfully loaded up the apache2 webserver, and php5. The one thing I didn't want is for Ubuntu during the installation to take one whole 1TB drive that contained a ton of stuff, but it was a backup drive so no biggie. But now I was transferring pics to the /var/www location and it copied a directory that contains spaces. Terminal seems to hang when I use the rm command, any ideas would be appreciated, thanks guys.


Solution 1:

Your terminal hangs, that's very odd. In the terminal I'm usually able to remove spaces by escaping the space character with a backslash:

rm -r test\ dir

If that doesn't work, have you tried enclosing it in single or double quotes:

rm -r "test dir" or rm -r 'test dir'

Another idea would be to install a terminal file manager such as Midnight Commander and try to remove the file that way. Good luck!