Server Fault is a question and answer site for system and network administrators. 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

Say my files on a ubuntu server are like:


I am in folder1 currently, and I want to move all files/folders (recursive) from folder2 to the current folder.

How can I do this?

share|improve this question
up vote 6 down vote accepted

shorter version:

mv folder2/* .
share|improve this answer

mv /folder1/folder2/* /folder1/

share|improve this answer

there is a caveat to be aware of if you have invisible files (starting with '.') in your folder. dotglob (*) won't expand (and mv won't move) invisible files unless you change it's behaviour with shopt. shopt -s dotglob to expand invisible files and shopt -u dotglob to switch back to default.

share|improve this answer

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.