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

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

1 Answer 1

up vote 71 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

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.