Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Say my files on a ubuntu server are like:

/folder1/folder2/

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

3 Answers 3

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

 
discard

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.