Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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:

  1. /home/user/my_static

  2. /home/user/static/

How do I rename my_static to static and remove static(2)?

share|improve this question
possible duplicate of How do I rename a directory via the command line? – Avinash Raj Apr 21 '14 at 5:11
up vote 106 down vote accepted


mv "old location" "new location"

mv /home/user/my_static /home/user/static

That command is used for moving and renaming files and directories.

share|improve this answer
For experienced users this comment is superfluous, but it's worth noting this will also unlink (remove) the original static directory. – gertvdijk Apr 12 '13 at 18:27
Sometime you may want to back the file up, like a config file, use cp /home/file1 /home/file1.bak you will have 2 files. – wlraider70 Apr 12 '13 at 18:46
finally! thank you so much. – Fabian Mar 17 '14 at 19:07
Good.............. thanks......... – Elby Feb 24 at 12:26

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.