Connecting Tech Pros Worldwide Help | Site Map

move directory command

Newbie
 
Join Date: Sep 2007
Posts: 22
#1: Jul 6 '09
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.
micmast's Avatar
Familiar Sight
 
Join Date: Mar 2008
Location: Belgium
Posts: 136
#2: Jul 6 '09

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
Newbie
 
Join Date: Sep 2007
Posts: 22
#3: Jul 6 '09

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.
micmast's Avatar
Familiar Sight
 
Join Date: Mar 2008
Location: Belgium
Posts: 136
#4: Jul 7 '09

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.
Newbie
 
Join Date: Sep 2007
Posts: 22
#5: Jul 7 '09

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
micmast's Avatar
Familiar Sight
 
Join Date: Mar 2008
Location: Belgium
Posts: 136
#6: Jul 7 '09

re: move directory command


no problem, I hope I can help you more in the future.
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,561
#7: Jul 21 '09

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.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,067
#8: Aug 18 '09

re: move directory command


Quote:

Originally Posted by drhowarddrfine View Post

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".
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,561
#9: Aug 21 '09

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.
Reply