move directory command 
July 6th, 2009, 01:09 AM
| | Newbie | | Join Date: Sep 2007
Posts: 22
| | |
Hi all,
Does anyone know how what move directory command I need to use:
I am in current directory tmp and I have a folder inside tmp name work I would like to get all contents(files, subfolders) from work to tmp. Can someone PLEASE HELP ME with this.
Thank you all in advance.
| 
July 6th, 2009, 07:55 AM
|  | Familiar Sight | | Join Date: Mar 2008 Location: Belgium
Posts: 132
| | | re: move directory command
mv /tmp/yourfolder /new/location/
You can generally handle a folder just like you handle a file. For example deleting a directory is also with the rm command (with the argument -r because you need to delete recursivly (bad spelling I know)). Hope this helps
| 
July 6th, 2009, 09:27 PM
| | Newbie | | Join Date: Sep 2007
Posts: 22
| | | re: move directory command
Thank you so much for your reply MicMast,
Could you help me out with two last question.
Im a little confuse. in your example mv /tmp/yourfolder /new/location/
do all the contents (everything files,subfolders) inside of "yourfolder" move to inside of "location" or does the folder its self ("yourfolder") with everything in it move inside of "location"?
My last question is what is recursively ? I come from a windows op. sorry to ask I looked and read in forums but don't really understand what it is.
Thank you so much for your time and patience Im just starting out with centos.
| 
July 7th, 2009, 01:01 PM
|  | Familiar Sight | | Join Date: Mar 2008 Location: Belgium
Posts: 132
| | | re: move directory command
if you execute
mv /tmp/yourfolder/* /new/location/folder/
you will copy the content of the folder in tmp to the new location
if you execute
mv /tmp/yourfolder /new/location/folder/
you will copy the folder incl the folder itself to the new location
recursivly is a more complex item. The wikipedia explanation is " Recursion, in mathematics and computer science, is a method of defining functions in which the function being defined is applied within its own definition. The term is also used more generally to describe a process of repeating objects in a self-similar way. For instance, when the surfaces of two mirrors are almost parallel with each other the nested images that occur are a form of infinite recursion." But basicly it means that when you try to delete a folder, the command must be sure the folder is empty before deleting the folder.
| 
July 7th, 2009, 03:22 PM
| | Newbie | | Join Date: Sep 2007
Posts: 22
| | | re: move directory command
Hi MicMast,
Now I understand!
Thank you so much for your time, patience and specially your help! I really appreciate it.
sean
| 
July 7th, 2009, 08:58 PM
|  | Familiar Sight | | Join Date: Mar 2008 Location: Belgium
Posts: 132
| | | re: move directory command
no problem, I hope I can help you more in the future.
| 
July 21st, 2009, 03:22 PM
|  | Expert | | Join Date: Sep 2006
Posts: 5,520
| | | re: move directory command
Please note that we call these "directories" and not folders, which is a Windows term. Perhaps it's a desktop term, too, but not native to *nix itself.
| 
August 18th, 2009, 07:39 PM
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North :)
Posts: 4,940
Provided Answers: 8 | | | re: move directory command Quote:
Originally Posted by drhowarddrfine Please note that we call these "directories" and not folders, which is a Windows term. Perhaps it's a desktop term, too, but not native to *nix itself. | Is "folder" really a Windows term?
I always refer to them as directories.
Edit: aha! it's not just a Windows term...this term was originally used by Apple Lisa and now "is used in almost all modern operating systems' desktop environments".
| 
August 21st, 2009, 12:48 PM
|  | Expert | | Join Date: Sep 2006
Posts: 5,520
| | | re: move directory command
Yes, Microsoft can't even do that on their own and has to copy it like they copy everything else.
I guess the term is appropriate in a desktop environment but incorrect anywhere else.
And, yes, I'm grumpy today.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|