How to move all files/folder/sub folder from one place to another?

How to move all files/folder/sub folder from one place to another? resursivly
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

logon as root..

mv origFolder locationFolder
to move folder and its subs: mv /pathtodir1 /pathtodir2
to copy folder and its subs: cp -r /pathtodir1 /pathtodir2
CalmSoulAuthor Commented:
I want to folder files/subfolder too in one shot

 mv /pathtodir1 /pathtodir2
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

yes that'll do it. you are basically renaming the parent directory.
Kent OlsenData Warehouse Architect / DBACommented:
Hi CalmSoul,

The mv command will move the entire directory and it's subdirectories in a single shot.  If the target location is on the same device as the source location, mv will simple move a couple of directory pointers.  Many, many gigs worth of data moved in the blink of on eye.  :)     If the source and target directories are on different devices, mv will copy / delete so that from the user's standpoint everything is where it was intended.

As both previous posters have suggested, use mv /oldpath /newpath

Good Luck,

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
calmsoul..   hope everything went ok man..  
If I want to move all subfolders from one folder to another then what command I need to give.
For Eg. I have a folder on c:\Test1 and in that I have many subfolders and I want to move all the subfolders to C:\Test2 but I don't want to move the Test1 folder (which is the parent folder).

Please suggest.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.