Google Answers Logo
View Question
 
Q: Moving Files in Linux - what is the command? ( Answered,   1 Comment )
Question  
Subject: Moving Files in Linux - what is the command?
Category: Computers > Operating Systems
Asked by: xemion-ga
List Price: $2.50
Posted: 08 Apr 2004 09:26 PDT
Expires: 08 May 2004 09:26 PDT
Question ID: 327169
In the linux shell, how do I move the contents of an entire folder
(including subfolders and files) back a folder.  For example, I want
everything in /root/folder/ moved to /root/.  What's the command for
that?
Answer  
Subject: Re: Moving Files in Linux - what is the command?
Answered By: paul_b_18-ga on 08 Apr 2004 09:41 PDT
 
Hi,

The command would be:

mv /root/folder/*.* /root/


If you need any more information, please ask for a clarification!

Thank you,
paul_b_18

Request for Answer Clarification by xemion-ga on 08 Apr 2004 09:45 PDT
It says:
"mv: can't stat source /httpdocs/xcart/*.*"

What's that mean?

Clarification of Answer by paul_b_18-ga on 08 Apr 2004 09:52 PDT
Hi,

Unfortunatly I've made a mistake. 
Thankfully, Cybaea-ga seems to have already given the correct answer
in his comment below.
I will try to cancel my answer so that you don't have to pay for it.

I'm verry sorry for the incovenience.
paul_b_18

Request for Answer Clarification by xemion-ga on 08 Apr 2004 09:56 PDT
That's alright.  The comment almost worked but I received some errors.
 It said the following:

"tar: ./templates_c/admin^main^configuration.tpl: file changed as we read it"

at the end it said:

"tar: Error exit delayed from previous errors"

None of the files were moved.  What happened?

Clarification of Answer by paul_b_18-ga on 08 Apr 2004 10:44 PDT
Hi,

try 

mv /root/folder/* /root/

Let me know if it solves your problem!

Thank you,
paul_b_18

Request for Answer Clarification by xemion-ga on 08 Apr 2004 11:06 PDT
It says "mv: can't stat source /root/folder/*"

You will receive a tip for your work we can get this working :-)  I
didn't mean for this $2.50 question to turn into this.

Clarification of Answer by paul_b_18-ga on 08 Apr 2004 11:13 PDT
Haha,
Please don't give me a tip: it's me who messed it up in the first place.
Anyway, I won't rest unil it's solved but I can only look into your
problem again in a couple of hours. I hope that's not a big problem
for you.

I will get a back to you!

Thank you,
paul_b_18

Clarification of Answer by paul_b_18-ga on 08 Apr 2004 15:16 PDT
Hi,

I'm quite surprised that it doens't seem to work.
Anyway, let's try to solve this. Can you give me the _exact_ names of
the two directory's: the directory from which you want to move the
files and the directory to which you want the files to be copied.

Thanks,
paul_b_18

Request for Answer Clarification by xemion-ga on 08 Apr 2004 16:01 PDT
Don't worry about it.  I solved tje prolem with a different method.  Thanks though!

Clarification of Answer by paul_b_18-ga on 08 Apr 2004 16:11 PDT
Hi,

I'm sorry I wasn't able to help you in the end. If you want, you can
ask for a refund at:
http://answers.google.com/answers/refundrequest

Thanks,
paul_b_18
Comments  
Subject: Re: Moving Files in Linux - what is the command?
From: cybaea-ga on 08 Apr 2004 09:45 PDT
 
The answer only moves files with a '.' in their name.

The traditional answer (using bash) is

# cd /root/folder/
# tar cvf - . | (cd /root/; tar xvf -)

This works across volumes.

Happy Easter.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy