Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a directory I want to rename without spaces. This is the path to the file with spaces /home/ebank36/minecraft/The Fall of Gondolin.

I want to rename that directory to TFoG so I would like it to look like

I need to do this so I can move a file out of that directory and place it in /home/ebank36/minecraft.

share|improve this question
up vote 2 down vote accepted

From a terminal, you could issue this command:

mv /home/ebank36/minecraft/The\ Fall\ of\ Gondolin /home/ebank36/minecraft/TFoG

(NOTICE the \ before the space. This is how bash knows the special character that follows the \ should be treated as part of the name)

Or, from a GUI, just click on that directory, press F2, and type the new name.

share|improve this answer
Thankyou this worked. – ebank36 Sep 15 '13 at 23:47
@ebank36 It should be noted that it's better to " quote the whole path rather than escaping individual space characters. Use this instead: mv "/home/ebank36/minecraft/The Fall of Gondolin" /home/ebank36/minecraft/TFoG – minerz029 Sep 15 '13 at 23:49
Ok I will try and remember for future questions. – ebank36 Sep 15 '13 at 23:52

You can do this by opening the folder in the file manager, and then right clicking the folder and selecting "Rename", typing in the new folder name. The keyboard shortcut for renaming a selected file or folder, or several selected files or folders for a group rename, is F2. You may also use the command line.

share|improve this answer
sorry this won't help considering I do not have the desktop installed. – ebank36 Sep 15 '13 at 23:46
Oh - that wasn't clear in your question. You may see the link I provided. – Richard Sep 15 '13 at 23:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.