What is the benefit of copy over xcopy on the command line?












29















I know that xcopy has more options however are there any benefits to using copy rather than xcopy?










share|improve this question




















  • 1





    Which copy? This one? This one?

    – JdeBP
    Feb 9 '12 at 12:12
















29















I know that xcopy has more options however are there any benefits to using copy rather than xcopy?










share|improve this question




















  • 1





    Which copy? This one? This one?

    – JdeBP
    Feb 9 '12 at 12:12














29












29








29


7






I know that xcopy has more options however are there any benefits to using copy rather than xcopy?










share|improve this question
















I know that xcopy has more options however are there any benefits to using copy rather than xcopy?







windows command-line file-transfer robocopy xcopy






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 '15 at 17:03









Flyk

1,37211928




1,37211928










asked Feb 9 '12 at 10:26









Phil HannentPhil Hannent

8501714




8501714








  • 1





    Which copy? This one? This one?

    – JdeBP
    Feb 9 '12 at 12:12














  • 1





    Which copy? This one? This one?

    – JdeBP
    Feb 9 '12 at 12:12








1




1





Which copy? This one? This one?

– JdeBP
Feb 9 '12 at 12:12





Which copy? This one? This one?

– JdeBP
Feb 9 '12 at 12:12










4 Answers
4






active

oldest

votes


















36
















  1. xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk.



    Since we have Windows and rescue CDs, that isn't really an issue anymore.




  2. copy can concatenate files.



    copy file1 + file2 file3


    creates a file (file3) which contains file1's and file2's contents.




  3. copy can copy more than just files.



    For example,



    copy con file


    lets you write directly from the keyboard (console) to file.



    Likewise, you can print a file using



    copy file prn
    copy file \computerprinter


    where the latter is for shared printers.



    You can even combine the above: The command



    copy con prn


    lets you write directly to the printer.








share|improve this answer





















  • 5





    Also, it's one less character to type when invoking it. :)

    – Orangutech
    May 31 '12 at 21:33











  • Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

    – Johnny_D
    Oct 10 '13 at 13:57



















21














I think the main difference is (or was) that xcopy is able to copy folder hierarchies and copy was intended to work on files only.

That being said, I don't think there is anything to gain (functionality- or performance-wise) from using copy.



Please note, even xcopy is outdated by today's standards. Robocopy is the new copy utility of choice on modern Windows platforms.



Also note that all the mentioned copy utilities have Wikipedia articles that could contain further information:




  • http://en.wikipedia.org/wiki/Copy_(command)

  • http://en.wikipedia.org/wiki/Xcopy

  • http://en.wikipedia.org/wiki/Robocopy






share|improve this answer

































    0














    If you consider Powershell a "command line" then there is another "copy" command available. The Powershell "copy" apparently maps to a cmdlet.



    One thing not mentioned by the other answers is that since Powershell expands a deeply embedded wildcard at the shell level, this command will work (only from PS not from DOS):



    % copy G:gitonesource*morePathSomePattern*.dll destDir


    while xcopy claims "file not found" since it accepts a single source.






    share|improve this answer

































      0














      Anyone remember DOS on dual floppy PCs? Xcopy minimises the number of read seeks by loading multiple files into memory on a single read to speed up the copy. Probably still makes a trivial speed improvement with HDDs.






      share|improve this answer



















      • 1





        At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

        – Scott
        Jan 10 at 1:03











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f387859%2fwhat-is-the-benefit-of-copy-over-xcopy-on-the-command-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      36
















      1. xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk.



        Since we have Windows and rescue CDs, that isn't really an issue anymore.




      2. copy can concatenate files.



        copy file1 + file2 file3


        creates a file (file3) which contains file1's and file2's contents.




      3. copy can copy more than just files.



        For example,



        copy con file


        lets you write directly from the keyboard (console) to file.



        Likewise, you can print a file using



        copy file prn
        copy file \computerprinter


        where the latter is for shared printers.



        You can even combine the above: The command



        copy con prn


        lets you write directly to the printer.








      share|improve this answer





















      • 5





        Also, it's one less character to type when invoking it. :)

        – Orangutech
        May 31 '12 at 21:33











      • Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

        – Johnny_D
        Oct 10 '13 at 13:57
















      36
















      1. xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk.



        Since we have Windows and rescue CDs, that isn't really an issue anymore.




      2. copy can concatenate files.



        copy file1 + file2 file3


        creates a file (file3) which contains file1's and file2's contents.




      3. copy can copy more than just files.



        For example,



        copy con file


        lets you write directly from the keyboard (console) to file.



        Likewise, you can print a file using



        copy file prn
        copy file \computerprinter


        where the latter is for shared printers.



        You can even combine the above: The command



        copy con prn


        lets you write directly to the printer.








      share|improve this answer





















      • 5





        Also, it's one less character to type when invoking it. :)

        – Orangutech
        May 31 '12 at 21:33











      • Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

        – Johnny_D
        Oct 10 '13 at 13:57














      36












      36








      36









      1. xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk.



        Since we have Windows and rescue CDs, that isn't really an issue anymore.




      2. copy can concatenate files.



        copy file1 + file2 file3


        creates a file (file3) which contains file1's and file2's contents.




      3. copy can copy more than just files.



        For example,



        copy con file


        lets you write directly from the keyboard (console) to file.



        Likewise, you can print a file using



        copy file prn
        copy file \computerprinter


        where the latter is for shared printers.



        You can even combine the above: The command



        copy con prn


        lets you write directly to the printer.








      share|improve this answer

















      1. xcopy is an external program, while copy is part of the interpreter (cmd.exe, command.com). This means that xcopy might not be present on another machine or a rescue disk.



        Since we have Windows and rescue CDs, that isn't really an issue anymore.




      2. copy can concatenate files.



        copy file1 + file2 file3


        creates a file (file3) which contains file1's and file2's contents.




      3. copy can copy more than just files.



        For example,



        copy con file


        lets you write directly from the keyboard (console) to file.



        Likewise, you can print a file using



        copy file prn
        copy file \computerprinter


        where the latter is for shared printers.



        You can even combine the above: The command



        copy con prn


        lets you write directly to the printer.









      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Oct 10 '13 at 21:29

























      answered Feb 9 '12 at 12:14









      DennisDennis

      40.7k7101136




      40.7k7101136








      • 5





        Also, it's one less character to type when invoking it. :)

        – Orangutech
        May 31 '12 at 21:33











      • Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

        – Johnny_D
        Oct 10 '13 at 13:57














      • 5





        Also, it's one less character to type when invoking it. :)

        – Orangutech
        May 31 '12 at 21:33











      • Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

        – Johnny_D
        Oct 10 '13 at 13:57








      5




      5





      Also, it's one less character to type when invoking it. :)

      – Orangutech
      May 31 '12 at 21:33





      Also, it's one less character to type when invoking it. :)

      – Orangutech
      May 31 '12 at 21:33













      Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

      – Johnny_D
      Oct 10 '13 at 13:57





      Wow, thanks for info regarding files concatenation. I've just found out it and understood why my result file was so big. You've made my day.

      – Johnny_D
      Oct 10 '13 at 13:57













      21














      I think the main difference is (or was) that xcopy is able to copy folder hierarchies and copy was intended to work on files only.

      That being said, I don't think there is anything to gain (functionality- or performance-wise) from using copy.



      Please note, even xcopy is outdated by today's standards. Robocopy is the new copy utility of choice on modern Windows platforms.



      Also note that all the mentioned copy utilities have Wikipedia articles that could contain further information:




      • http://en.wikipedia.org/wiki/Copy_(command)

      • http://en.wikipedia.org/wiki/Xcopy

      • http://en.wikipedia.org/wiki/Robocopy






      share|improve this answer






























        21














        I think the main difference is (or was) that xcopy is able to copy folder hierarchies and copy was intended to work on files only.

        That being said, I don't think there is anything to gain (functionality- or performance-wise) from using copy.



        Please note, even xcopy is outdated by today's standards. Robocopy is the new copy utility of choice on modern Windows platforms.



        Also note that all the mentioned copy utilities have Wikipedia articles that could contain further information:




        • http://en.wikipedia.org/wiki/Copy_(command)

        • http://en.wikipedia.org/wiki/Xcopy

        • http://en.wikipedia.org/wiki/Robocopy






        share|improve this answer




























          21












          21








          21







          I think the main difference is (or was) that xcopy is able to copy folder hierarchies and copy was intended to work on files only.

          That being said, I don't think there is anything to gain (functionality- or performance-wise) from using copy.



          Please note, even xcopy is outdated by today's standards. Robocopy is the new copy utility of choice on modern Windows platforms.



          Also note that all the mentioned copy utilities have Wikipedia articles that could contain further information:




          • http://en.wikipedia.org/wiki/Copy_(command)

          • http://en.wikipedia.org/wiki/Xcopy

          • http://en.wikipedia.org/wiki/Robocopy






          share|improve this answer















          I think the main difference is (or was) that xcopy is able to copy folder hierarchies and copy was intended to work on files only.

          That being said, I don't think there is anything to gain (functionality- or performance-wise) from using copy.



          Please note, even xcopy is outdated by today's standards. Robocopy is the new copy utility of choice on modern Windows platforms.



          Also note that all the mentioned copy utilities have Wikipedia articles that could contain further information:




          • http://en.wikipedia.org/wiki/Copy_(command)

          • http://en.wikipedia.org/wiki/Xcopy

          • http://en.wikipedia.org/wiki/Robocopy







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 9 '12 at 12:23









          DMA57361

          16.9k66195




          16.9k66195










          answered Feb 9 '12 at 12:08









          Der HochstaplerDer Hochstapler

          67.9k49230285




          67.9k49230285























              0














              If you consider Powershell a "command line" then there is another "copy" command available. The Powershell "copy" apparently maps to a cmdlet.



              One thing not mentioned by the other answers is that since Powershell expands a deeply embedded wildcard at the shell level, this command will work (only from PS not from DOS):



              % copy G:gitonesource*morePathSomePattern*.dll destDir


              while xcopy claims "file not found" since it accepts a single source.






              share|improve this answer






























                0














                If you consider Powershell a "command line" then there is another "copy" command available. The Powershell "copy" apparently maps to a cmdlet.



                One thing not mentioned by the other answers is that since Powershell expands a deeply embedded wildcard at the shell level, this command will work (only from PS not from DOS):



                % copy G:gitonesource*morePathSomePattern*.dll destDir


                while xcopy claims "file not found" since it accepts a single source.






                share|improve this answer




























                  0












                  0








                  0







                  If you consider Powershell a "command line" then there is another "copy" command available. The Powershell "copy" apparently maps to a cmdlet.



                  One thing not mentioned by the other answers is that since Powershell expands a deeply embedded wildcard at the shell level, this command will work (only from PS not from DOS):



                  % copy G:gitonesource*morePathSomePattern*.dll destDir


                  while xcopy claims "file not found" since it accepts a single source.






                  share|improve this answer















                  If you consider Powershell a "command line" then there is another "copy" command available. The Powershell "copy" apparently maps to a cmdlet.



                  One thing not mentioned by the other answers is that since Powershell expands a deeply embedded wildcard at the shell level, this command will work (only from PS not from DOS):



                  % copy G:gitonesource*morePathSomePattern*.dll destDir


                  while xcopy claims "file not found" since it accepts a single source.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 3 '18 at 3:04

























                  answered Jan 3 '18 at 2:39









                  crokusekcrokusek

                  4031511




                  4031511























                      0














                      Anyone remember DOS on dual floppy PCs? Xcopy minimises the number of read seeks by loading multiple files into memory on a single read to speed up the copy. Probably still makes a trivial speed improvement with HDDs.






                      share|improve this answer



















                      • 1





                        At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                        – Scott
                        Jan 10 at 1:03
















                      0














                      Anyone remember DOS on dual floppy PCs? Xcopy minimises the number of read seeks by loading multiple files into memory on a single read to speed up the copy. Probably still makes a trivial speed improvement with HDDs.






                      share|improve this answer



















                      • 1





                        At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                        – Scott
                        Jan 10 at 1:03














                      0












                      0








                      0







                      Anyone remember DOS on dual floppy PCs? Xcopy minimises the number of read seeks by loading multiple files into memory on a single read to speed up the copy. Probably still makes a trivial speed improvement with HDDs.






                      share|improve this answer













                      Anyone remember DOS on dual floppy PCs? Xcopy minimises the number of read seeks by loading multiple files into memory on a single read to speed up the copy. Probably still makes a trivial speed improvement with HDDs.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Jan 10 at 0:48









                      BillBill

                      1




                      1








                      • 1





                        At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                        – Scott
                        Jan 10 at 1:03














                      • 1





                        At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                        – Scott
                        Jan 10 at 1:03








                      1




                      1





                      At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                      – Scott
                      Jan 10 at 1:03





                      At the risk of splitting hairs, this is not, strictly speaking, an answer to the question, since it asks for benefit(s) of copy over xcopy.  But, IMO, this is a valid contribution to the discussion.

                      – Scott
                      Jan 10 at 1:03


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f387859%2fwhat-is-the-benefit-of-copy-over-xcopy-on-the-command-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Сан-Квентин

                      8-я гвардейская общевойсковая армия

                      Алькесар