Move file to external hard drive sub-directory Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Copy files from internal hard drive to external hard drive using command line in ubuntu 14.04SeaGate FreeAgent External Hard Drive Keeps Auto-mounting RepeatedlyBacking up a VM server to an external USB driveMounting Second Hard Drive in Ubuntu 11.10How can I access an external hard drive through Ubuntu Linux?How do I get GRUB to load properly from a USB external hard drive?Unable to mount hard drive for file copyBackup network CIFS share to external storage16.04 can't mount USB hard drive, but can mount flash drive?How to burn .iso file to external hard-driveHow to mount second hard drive correctly

How would a mousetrap for use in space work?

Can an alien society believe that their star system is the universe?

Why are there no cargo aircraft with "flying wing" design?

Do I really need to have a message in a novel to appeal to readers?

Compare a given version number in the form major.minor.build.patch and see if one is less than the other

What font is "z" in "z-score"?

Is it a good idea to use CNN to classify 1D signal?

How to find all the available tools in mac terminal?

Denied boarding although I have proper visa and documentation. To whom should I make a complaint?

How could we fake a moon landing now?

Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?

Extracting terms with certain heads in a function

Maximum summed powersets with non-adjacent items

How to tell that you are a giant?

Did MS DOS itself ever use blinking text?

Using et al. for a last / senior author rather than for a first author

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

Delete nth line from bottom

Crossing US/Canada Border for less than 24 hours

First console to have temporary backward compatibility

How do pianists reach extremely loud dynamics?

Significance of Cersei's obsession with elephants?

Can a new player join a group only when a new campaign starts?

Using audio cues to encourage good posture



Move file to external hard drive sub-directory



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Copy files from internal hard drive to external hard drive using command line in ubuntu 14.04SeaGate FreeAgent External Hard Drive Keeps Auto-mounting RepeatedlyBacking up a VM server to an external USB driveMounting Second Hard Drive in Ubuntu 11.10How can I access an external hard drive through Ubuntu Linux?How do I get GRUB to load properly from a USB external hard drive?Unable to mount hard drive for file copyBackup network CIFS share to external storage16.04 can't mount USB hard drive, but can mount flash drive?How to burn .iso file to external hard-driveHow to mount second hard drive correctly



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:



/Backup
/Backup/Jan_02_2016
/Backup/Jun_02_2016
robert_11042016.pdf
pre_install_15102014.pdf
Magazine_2012.pdf


I need to create a new sub-directory named /Backup/Dec_02_2016. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt to a new sub-directory /Backup/Dec_02_2016 on the usb drive.



Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with



mount /dev/sdb1 /mnt/usb


and then just copy the file to /mnt/usb. This would place the file in the main directory of the external USB drive and then I could unmount.



Problem:



Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016 and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.



Question:



Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?










share|improve this question






























    0















    I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:



    /Backup
    /Backup/Jan_02_2016
    /Backup/Jun_02_2016
    robert_11042016.pdf
    pre_install_15102014.pdf
    Magazine_2012.pdf


    I need to create a new sub-directory named /Backup/Dec_02_2016. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt to a new sub-directory /Backup/Dec_02_2016 on the usb drive.



    Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with



    mount /dev/sdb1 /mnt/usb


    and then just copy the file to /mnt/usb. This would place the file in the main directory of the external USB drive and then I could unmount.



    Problem:



    Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016 and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.



    Question:



    Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?










    share|improve this question


























      0












      0








      0


      1






      I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:



      /Backup
      /Backup/Jan_02_2016
      /Backup/Jun_02_2016
      robert_11042016.pdf
      pre_install_15102014.pdf
      Magazine_2012.pdf


      I need to create a new sub-directory named /Backup/Dec_02_2016. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt to a new sub-directory /Backup/Dec_02_2016 on the usb drive.



      Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with



      mount /dev/sdb1 /mnt/usb


      and then just copy the file to /mnt/usb. This would place the file in the main directory of the external USB drive and then I could unmount.



      Problem:



      Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016 and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.



      Question:



      Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?










      share|improve this question
















      I am looking to copy a file from a sub-directory on my Ubuntu 16.04 system to an external USB drive (this one) using the CLI. The drive has the following file and folder structure:



      /Backup
      /Backup/Jan_02_2016
      /Backup/Jun_02_2016
      robert_11042016.pdf
      pre_install_15102014.pdf
      Magazine_2012.pdf


      I need to create a new sub-directory named /Backup/Dec_02_2016. Then I need to copy /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt to a new sub-directory /Backup/Dec_02_2016 on the usb drive.



      Previously, I have only copied files to the main directory of the external drive, so I did not need to create sub-directories - I would just mount the drive with



      mount /dev/sdb1 /mnt/usb


      and then just copy the file to /mnt/usb. This would place the file in the main directory of the external USB drive and then I could unmount.



      Problem:



      Here, the problem I am facing is that I now need to place the file in the subdirectory /Backup/Dec_02_2016 and not in the main directory of the drive. I had a look here but it does not indicate how to mount the drive to a mount point with the proper sub-directory structure.



      Question:



      Is there a way to place this file directly in the sub-directory? Or do I need to place it in the main directory and then move it?







      16.04 usb mount hard-drive






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 13 '17 at 12:23









      Community

      1




      1










      asked Nov 14 '16 at 18:41









      edeszedesz

      293412




      293412




















          2 Answers
          2






          active

          oldest

          votes


















          2














          1. Mount the device as /mnt/usb



          2. Create a folder



            mkdir -p /mnt/usb/Backup/Dec_02_2016



          3. Copy to the recently mounted device



            cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016






          share|improve this answer

























          • Thanks! Why did you use cp -p instead of cp?

            – edesz
            Nov 14 '16 at 18:53












          • That way it preserves the specified attributes of the original files, in case there is any.

            – M. Becerra
            Nov 14 '16 at 18:59











          • Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

            – edesz
            Nov 14 '16 at 19:04











          • Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

            – Tom McKenzie
            Oct 11 '18 at 7:13


















          0














          You can simply use move command and set path of hard disk.



          sudo mv fromPath/ /media/username/harddisk name/


          Thanks.





          share








          New contributor




          Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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%2faskubuntu.com%2fquestions%2f849453%2fmove-file-to-external-hard-drive-sub-directory%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            1. Mount the device as /mnt/usb



            2. Create a folder



              mkdir -p /mnt/usb/Backup/Dec_02_2016



            3. Copy to the recently mounted device



              cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016






            share|improve this answer

























            • Thanks! Why did you use cp -p instead of cp?

              – edesz
              Nov 14 '16 at 18:53












            • That way it preserves the specified attributes of the original files, in case there is any.

              – M. Becerra
              Nov 14 '16 at 18:59











            • Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

              – edesz
              Nov 14 '16 at 19:04











            • Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

              – Tom McKenzie
              Oct 11 '18 at 7:13















            2














            1. Mount the device as /mnt/usb



            2. Create a folder



              mkdir -p /mnt/usb/Backup/Dec_02_2016



            3. Copy to the recently mounted device



              cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016






            share|improve this answer

























            • Thanks! Why did you use cp -p instead of cp?

              – edesz
              Nov 14 '16 at 18:53












            • That way it preserves the specified attributes of the original files, in case there is any.

              – M. Becerra
              Nov 14 '16 at 18:59











            • Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

              – edesz
              Nov 14 '16 at 19:04











            • Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

              – Tom McKenzie
              Oct 11 '18 at 7:13













            2












            2








            2







            1. Mount the device as /mnt/usb



            2. Create a folder



              mkdir -p /mnt/usb/Backup/Dec_02_2016



            3. Copy to the recently mounted device



              cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016






            share|improve this answer















            1. Mount the device as /mnt/usb



            2. Create a folder



              mkdir -p /mnt/usb/Backup/Dec_02_2016



            3. Copy to the recently mounted device



              cp -p /home/User_F_Readout/Downloads/Temp_Report_56_09242016.txt /mnt/usb/Backup/Dec_02_2016







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 14 '16 at 19:10









            wjandrea

            9,57142765




            9,57142765










            answered Nov 14 '16 at 18:46









            Larry R. IrwinLarry R. Irwin

            1245




            1245












            • Thanks! Why did you use cp -p instead of cp?

              – edesz
              Nov 14 '16 at 18:53












            • That way it preserves the specified attributes of the original files, in case there is any.

              – M. Becerra
              Nov 14 '16 at 18:59











            • Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

              – edesz
              Nov 14 '16 at 19:04











            • Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

              – Tom McKenzie
              Oct 11 '18 at 7:13

















            • Thanks! Why did you use cp -p instead of cp?

              – edesz
              Nov 14 '16 at 18:53












            • That way it preserves the specified attributes of the original files, in case there is any.

              – M. Becerra
              Nov 14 '16 at 18:59











            • Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

              – edesz
              Nov 14 '16 at 19:04











            • Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

              – Tom McKenzie
              Oct 11 '18 at 7:13
















            Thanks! Why did you use cp -p instead of cp?

            – edesz
            Nov 14 '16 at 18:53






            Thanks! Why did you use cp -p instead of cp?

            – edesz
            Nov 14 '16 at 18:53














            That way it preserves the specified attributes of the original files, in case there is any.

            – M. Becerra
            Nov 14 '16 at 18:59





            That way it preserves the specified attributes of the original files, in case there is any.

            – M. Becerra
            Nov 14 '16 at 18:59













            Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

            – edesz
            Nov 14 '16 at 19:04





            Thanks. Then should we always use cp -p? i.e. is cp -p safer than cp?

            – edesz
            Nov 14 '16 at 19:04













            Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

            – Tom McKenzie
            Oct 11 '18 at 7:13





            Only if you intend to keep all existing permissions. Not always desirable if you're copy files to a drive you might move to a different machine (with different users and groups)

            – Tom McKenzie
            Oct 11 '18 at 7:13













            0














            You can simply use move command and set path of hard disk.



            sudo mv fromPath/ /media/username/harddisk name/


            Thanks.





            share








            New contributor




            Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
























              0














              You can simply use move command and set path of hard disk.



              sudo mv fromPath/ /media/username/harddisk name/


              Thanks.





              share








              New contributor




              Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                0












                0








                0







                You can simply use move command and set path of hard disk.



                sudo mv fromPath/ /media/username/harddisk name/


                Thanks.





                share








                New contributor




                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                You can simply use move command and set path of hard disk.



                sudo mv fromPath/ /media/username/harddisk name/


                Thanks.






                share








                New contributor




                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.








                share


                share






                New contributor




                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 7 mins ago









                Sohel KhanSohel Khan

                1




                1




                New contributor




                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Sohel Khan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f849453%2fmove-file-to-external-hard-drive-sub-directory%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

                    Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

                    Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

                    Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org