move directory command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seanh
    New Member
    • Sep 2007
    • 28

    move directory command

    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
    New Member
    • Mar 2008
    • 144

    #2
    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

    Comment

    • seanh
      New Member
      • Sep 2007
      • 28

      #3
      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,subfolder s) 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.

      Comment

      • micmast
        New Member
        • Mar 2008
        • 144

        #4
        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.

        Comment

        • seanh
          New Member
          • Sep 2007
          • 28

          #5
          Hi MicMast,
          Now I understand!
          Thank you so much for your time, patience and specially your help! I really appreciate it.
          sean

          Comment

          • micmast
            New Member
            • Mar 2008
            • 144

            #6
            no problem, I hope I can help you more in the future.

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              Please note that we call these "directorie s" and not folders, which is a Windows term. Perhaps it's a desktop term, too, but not native to *nix itself.

              Comment

              • Frinavale
                Recognized Expert Expert
                • Oct 2006
                • 9749

                #8
                Originally posted by drhowarddrfine
                Please note that we call these "directorie s" 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".

                Comment

                • drhowarddrfine
                  Recognized Expert Expert
                  • Sep 2006
                  • 7434

                  #9
                  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.

                  Comment

                  Working...