?
Solved

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

Posted on 2007-10-01
7
Medium Priority
?
6,413 Views
Last Modified: 2012-08-13
How to move all files/folder/sub folder from one place to another? resursivly
0
Comment
Question by:CalmSoul
7 Comments
 
LVL 4

Expert Comment

by:pstrawser
ID: 19992309
logon as root..

mv origFolder locationFolder
0
 
LVL 3

Expert Comment

by:ckhsu1977
ID: 19992318
to move folder and its subs: mv /pathtodir1 /pathtodir2
to copy folder and its subs: cp -r /pathtodir1 /pathtodir2
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 19992374
I want to folder files/subfolder too in one shot

 mv /pathtodir1 /pathtodir2
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:ckhsu1977
ID: 19992440
yes that'll do it. you are basically renaming the parent directory.
0
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 2000 total points
ID: 19992454
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,
Kent
0
 
LVL 4

Expert Comment

by:pstrawser
ID: 20003445
calmsoul..   hope everything went ok man..  
0
 
LVL 1

Expert Comment

by:chmdznr
ID: 21446851
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.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question