How can I copy a file and create the target directories at the same time?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












20















I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd



How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed and copies the file?



Right now I get
No such file or directory as deep and sea don't exist.



I looked thru the man help pages and other questions but nothing jumps out at me.



The closest I've got is using rcp for the directory:



rcp -r aaa/deep/sea/ bbb/deep/sea/


though this copies the whole directory and contents and I just want the one file. Trying to do that however gave cp: cannot create regular file bbb/deep/sea/blob.psd' such file or directory










share|improve this question




























    20















    I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd



    How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed and copies the file?



    Right now I get
    No such file or directory as deep and sea don't exist.



    I looked thru the man help pages and other questions but nothing jumps out at me.



    The closest I've got is using rcp for the directory:



    rcp -r aaa/deep/sea/ bbb/deep/sea/


    though this copies the whole directory and contents and I just want the one file. Trying to do that however gave cp: cannot create regular file bbb/deep/sea/blob.psd' such file or directory










    share|improve this question


























      20












      20








      20


      11






      I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd



      How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed and copies the file?



      Right now I get
      No such file or directory as deep and sea don't exist.



      I looked thru the man help pages and other questions but nothing jumps out at me.



      The closest I've got is using rcp for the directory:



      rcp -r aaa/deep/sea/ bbb/deep/sea/


      though this copies the whole directory and contents and I just want the one file. Trying to do that however gave cp: cannot create regular file bbb/deep/sea/blob.psd' such file or directory










      share|improve this question
















      I want to cp aaa/deep/sea/blob.psd to bbb/deep/sea/blob.psd



      How do I do the copy if the deep and sea directories don't exist under bbb so that the copy both creates the directories that are needed and copies the file?



      Right now I get
      No such file or directory as deep and sea don't exist.



      I looked thru the man help pages and other questions but nothing jumps out at me.



      The closest I've got is using rcp for the directory:



      rcp -r aaa/deep/sea/ bbb/deep/sea/


      though this copies the whole directory and contents and I just want the one file. Trying to do that however gave cp: cannot create regular file bbb/deep/sea/blob.psd' such file or directory







      directory file-copy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 28 at 1:48









      Jeff Schaller

      43.9k1161141




      43.9k1161141










      asked Jun 27 '12 at 17:58









      Michael DurrantMichael Durrant

      16.4k45121186




      16.4k45121186




















          5 Answers
          5






          active

          oldest

          votes


















          19














          Try to use such next function for such situation:



          copy_wdir() mkdir -p -- "$(dirname -- "$2")" && cp -- "$1" "$2" ; 


          and use it as



          copy_wdir aaa/deep/sea/blob.psd bbb/deep/sea/blob.psd


          By the way, GNU cp has a --parents option. It's really close to what you want, but not exactly.

          It will also create aaa directory that seems you don't need. However you can first cd to aaa and copy like:



          cd aaa && cp --parents deep/sea/blob.psd ../bbb/





          share|improve this answer
































            26














            It's easy using the install program from the coreutils that is typically used for this very purpose by build systems like automake:



            install -D /path/to/source /path/to/destination


            Note that install creates all parts of the path just like mkdir -p does, see man install. I'm curious why you didn't include why you want to do that. Calling mkdir and cp is very easy.






            share|improve this answer




















            • 2





              I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

              – Patrick
              May 6 '14 at 19:48











            • Use -d instead of -D on a Mac.

              – Matt M.
              Nov 14 '16 at 23:01











            • note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

              – törzsmókus
              Jan 9 at 19:19


















            7














            With standard (POSIX/Unix) commands, you've got:



            pax -rws ':^:dest/dir/:' file .





            share|improve this answer




















            • 1





              Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

              – Patrick
              May 6 '14 at 19:41












            • @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

              – mikeserv
              Oct 9 '14 at 6:01



















            6














            I'm not aware of a way of doing it using cp, but it's certainly possible using rsync:



            $ rsync sourcefile dir/


            where dir is a directory that does not have to exist. There are lots of other ways of achieving the same using other commands.






            share|improve this answer


















            • 3





              You need rsync -R to preserve the directory heirarchy

              – glenn jackman
              May 6 '14 at 19:59











            • @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

              – mjturner
              May 6 '14 at 20:10







            • 1





              At least the GNU cp has the --parents option.

              – peterph
              May 6 '14 at 20:45






            • 2





              @peterph Indeed, but then you're restricted in the naming of the target directory

              – mjturner
              May 7 '14 at 7:49


















            5














            cd aaa
            pax -rw deep/sea/blob.psd ../bbb


            If you don't have pax (it's mandated by POSIX, as a standard replacement of cpio and tar which had too many incompatibilities to standardize), use cpio -p or tar -cf - … | tar -xf - instead.






            share|improve this answer






















              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "106"
              ;
              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: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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%2funix.stackexchange.com%2fquestions%2f41770%2fhow-can-i-copy-a-file-and-create-the-target-directories-at-the-same-time%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              5 Answers
              5






              active

              oldest

              votes








              5 Answers
              5






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              19














              Try to use such next function for such situation:



              copy_wdir() mkdir -p -- "$(dirname -- "$2")" && cp -- "$1" "$2" ; 


              and use it as



              copy_wdir aaa/deep/sea/blob.psd bbb/deep/sea/blob.psd


              By the way, GNU cp has a --parents option. It's really close to what you want, but not exactly.

              It will also create aaa directory that seems you don't need. However you can first cd to aaa and copy like:



              cd aaa && cp --parents deep/sea/blob.psd ../bbb/





              share|improve this answer





























                19














                Try to use such next function for such situation:



                copy_wdir() mkdir -p -- "$(dirname -- "$2")" && cp -- "$1" "$2" ; 


                and use it as



                copy_wdir aaa/deep/sea/blob.psd bbb/deep/sea/blob.psd


                By the way, GNU cp has a --parents option. It's really close to what you want, but not exactly.

                It will also create aaa directory that seems you don't need. However you can first cd to aaa and copy like:



                cd aaa && cp --parents deep/sea/blob.psd ../bbb/





                share|improve this answer



























                  19












                  19








                  19







                  Try to use such next function for such situation:



                  copy_wdir() mkdir -p -- "$(dirname -- "$2")" && cp -- "$1" "$2" ; 


                  and use it as



                  copy_wdir aaa/deep/sea/blob.psd bbb/deep/sea/blob.psd


                  By the way, GNU cp has a --parents option. It's really close to what you want, but not exactly.

                  It will also create aaa directory that seems you don't need. However you can first cd to aaa and copy like:



                  cd aaa && cp --parents deep/sea/blob.psd ../bbb/





                  share|improve this answer















                  Try to use such next function for such situation:



                  copy_wdir() mkdir -p -- "$(dirname -- "$2")" && cp -- "$1" "$2" ; 


                  and use it as



                  copy_wdir aaa/deep/sea/blob.psd bbb/deep/sea/blob.psd


                  By the way, GNU cp has a --parents option. It's really close to what you want, but not exactly.

                  It will also create aaa directory that seems you don't need. However you can first cd to aaa and copy like:



                  cd aaa && cp --parents deep/sea/blob.psd ../bbb/






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 7 '14 at 17:13









                  Stéphane Chazelas

                  311k57587945




                  311k57587945










                  answered Jun 27 '12 at 18:17









                  rushrush

                  19.4k46596




                  19.4k46596























                      26














                      It's easy using the install program from the coreutils that is typically used for this very purpose by build systems like automake:



                      install -D /path/to/source /path/to/destination


                      Note that install creates all parts of the path just like mkdir -p does, see man install. I'm curious why you didn't include why you want to do that. Calling mkdir and cp is very easy.






                      share|improve this answer




















                      • 2





                        I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                        – Patrick
                        May 6 '14 at 19:48











                      • Use -d instead of -D on a Mac.

                        – Matt M.
                        Nov 14 '16 at 23:01











                      • note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                        – törzsmókus
                        Jan 9 at 19:19















                      26














                      It's easy using the install program from the coreutils that is typically used for this very purpose by build systems like automake:



                      install -D /path/to/source /path/to/destination


                      Note that install creates all parts of the path just like mkdir -p does, see man install. I'm curious why you didn't include why you want to do that. Calling mkdir and cp is very easy.






                      share|improve this answer




















                      • 2





                        I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                        – Patrick
                        May 6 '14 at 19:48











                      • Use -d instead of -D on a Mac.

                        – Matt M.
                        Nov 14 '16 at 23:01











                      • note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                        – törzsmókus
                        Jan 9 at 19:19













                      26












                      26








                      26







                      It's easy using the install program from the coreutils that is typically used for this very purpose by build systems like automake:



                      install -D /path/to/source /path/to/destination


                      Note that install creates all parts of the path just like mkdir -p does, see man install. I'm curious why you didn't include why you want to do that. Calling mkdir and cp is very easy.






                      share|improve this answer















                      It's easy using the install program from the coreutils that is typically used for this very purpose by build systems like automake:



                      install -D /path/to/source /path/to/destination


                      Note that install creates all parts of the path just like mkdir -p does, see man install. I'm curious why you didn't include why you want to do that. Calling mkdir and cp is very easy.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited May 6 '14 at 19:32

























                      answered May 6 '14 at 19:26









                      Pavel ŠimerdaPavel Šimerda

                      3,75911729




                      3,75911729







                      • 2





                        I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                        – Patrick
                        May 6 '14 at 19:48











                      • Use -d instead of -D on a Mac.

                        – Matt M.
                        Nov 14 '16 at 23:01











                      • note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                        – törzsmókus
                        Jan 9 at 19:19












                      • 2





                        I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                        – Patrick
                        May 6 '14 at 19:48











                      • Use -d instead of -D on a Mac.

                        – Matt M.
                        Nov 14 '16 at 23:01











                      • note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                        – törzsmókus
                        Jan 9 at 19:19







                      2




                      2





                      I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                      – Patrick
                      May 6 '14 at 19:48





                      I think there are a lot of good answers on this question, but this one gets my vote as it's the most portable. The rsync answer will only create 1 directory, and pax doesn't seem to be common.

                      – Patrick
                      May 6 '14 at 19:48













                      Use -d instead of -D on a Mac.

                      – Matt M.
                      Nov 14 '16 at 23:01





                      Use -d instead of -D on a Mac.

                      – Matt M.
                      Nov 14 '16 at 23:01













                      note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                      – törzsmókus
                      Jan 9 at 19:19





                      note that this command creates the destination files with 755 (rwxr-xr-x) permissions, which is probably not desired. you can specify something else with the -m switch, but I could not find a way to just keep the file permissions :(

                      – törzsmókus
                      Jan 9 at 19:19











                      7














                      With standard (POSIX/Unix) commands, you've got:



                      pax -rws ':^:dest/dir/:' file .





                      share|improve this answer




















                      • 1





                        Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                        – Patrick
                        May 6 '14 at 19:41












                      • @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                        – mikeserv
                        Oct 9 '14 at 6:01
















                      7














                      With standard (POSIX/Unix) commands, you've got:



                      pax -rws ':^:dest/dir/:' file .





                      share|improve this answer




















                      • 1





                        Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                        – Patrick
                        May 6 '14 at 19:41












                      • @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                        – mikeserv
                        Oct 9 '14 at 6:01














                      7












                      7








                      7







                      With standard (POSIX/Unix) commands, you've got:



                      pax -rws ':^:dest/dir/:' file .





                      share|improve this answer















                      With standard (POSIX/Unix) commands, you've got:



                      pax -rws ':^:dest/dir/:' file .






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Sep 28 '15 at 20:40

























                      answered May 6 '14 at 19:36









                      Stéphane ChazelasStéphane Chazelas

                      311k57587945




                      311k57587945







                      • 1





                        Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                        – Patrick
                        May 6 '14 at 19:41












                      • @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                        – mikeserv
                        Oct 9 '14 at 6:01













                      • 1





                        Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                        – Patrick
                        May 6 '14 at 19:41












                      • @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                        – mikeserv
                        Oct 9 '14 at 6:01








                      1




                      1





                      Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                      – Patrick
                      May 6 '14 at 19:41






                      Interesting. I'd never heard of pax before. Though I like its concept. Unfortunately even though it's in POSIX, it seems very few distros install it by default :-(

                      – Patrick
                      May 6 '14 at 19:41














                      @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                      – mikeserv
                      Oct 9 '14 at 6:01






                      @Patrick - if you skip all the way to the end of info tar - somewhere around the portability concerns section - i think youll find that GNU tar claims to be fully pax compatible. I did anyway, though i have never yet got around to putting those claims to a test.

                      – mikeserv
                      Oct 9 '14 at 6:01












                      6














                      I'm not aware of a way of doing it using cp, but it's certainly possible using rsync:



                      $ rsync sourcefile dir/


                      where dir is a directory that does not have to exist. There are lots of other ways of achieving the same using other commands.






                      share|improve this answer


















                      • 3





                        You need rsync -R to preserve the directory heirarchy

                        – glenn jackman
                        May 6 '14 at 19:59











                      • @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                        – mjturner
                        May 6 '14 at 20:10







                      • 1





                        At least the GNU cp has the --parents option.

                        – peterph
                        May 6 '14 at 20:45






                      • 2





                        @peterph Indeed, but then you're restricted in the naming of the target directory

                        – mjturner
                        May 7 '14 at 7:49















                      6














                      I'm not aware of a way of doing it using cp, but it's certainly possible using rsync:



                      $ rsync sourcefile dir/


                      where dir is a directory that does not have to exist. There are lots of other ways of achieving the same using other commands.






                      share|improve this answer


















                      • 3





                        You need rsync -R to preserve the directory heirarchy

                        – glenn jackman
                        May 6 '14 at 19:59











                      • @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                        – mjturner
                        May 6 '14 at 20:10







                      • 1





                        At least the GNU cp has the --parents option.

                        – peterph
                        May 6 '14 at 20:45






                      • 2





                        @peterph Indeed, but then you're restricted in the naming of the target directory

                        – mjturner
                        May 7 '14 at 7:49













                      6












                      6








                      6







                      I'm not aware of a way of doing it using cp, but it's certainly possible using rsync:



                      $ rsync sourcefile dir/


                      where dir is a directory that does not have to exist. There are lots of other ways of achieving the same using other commands.






                      share|improve this answer













                      I'm not aware of a way of doing it using cp, but it's certainly possible using rsync:



                      $ rsync sourcefile dir/


                      where dir is a directory that does not have to exist. There are lots of other ways of achieving the same using other commands.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered May 6 '14 at 19:28









                      mjturnermjturner

                      4,2161526




                      4,2161526







                      • 3





                        You need rsync -R to preserve the directory heirarchy

                        – glenn jackman
                        May 6 '14 at 19:59











                      • @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                        – mjturner
                        May 6 '14 at 20:10







                      • 1





                        At least the GNU cp has the --parents option.

                        – peterph
                        May 6 '14 at 20:45






                      • 2





                        @peterph Indeed, but then you're restricted in the naming of the target directory

                        – mjturner
                        May 7 '14 at 7:49












                      • 3





                        You need rsync -R to preserve the directory heirarchy

                        – glenn jackman
                        May 6 '14 at 19:59











                      • @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                        – mjturner
                        May 6 '14 at 20:10







                      • 1





                        At least the GNU cp has the --parents option.

                        – peterph
                        May 6 '14 at 20:45






                      • 2





                        @peterph Indeed, but then you're restricted in the naming of the target directory

                        – mjturner
                        May 7 '14 at 7:49







                      3




                      3





                      You need rsync -R to preserve the directory heirarchy

                      – glenn jackman
                      May 6 '14 at 19:59





                      You need rsync -R to preserve the directory heirarchy

                      – glenn jackman
                      May 6 '14 at 19:59













                      @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                      – mjturner
                      May 6 '14 at 20:10






                      @glennjackman Indeed, 'proper' use of rsync needs more options, but the question was simply about creating a non-existent target directory, hence my brief answer :)

                      – mjturner
                      May 6 '14 at 20:10





                      1




                      1





                      At least the GNU cp has the --parents option.

                      – peterph
                      May 6 '14 at 20:45





                      At least the GNU cp has the --parents option.

                      – peterph
                      May 6 '14 at 20:45




                      2




                      2





                      @peterph Indeed, but then you're restricted in the naming of the target directory

                      – mjturner
                      May 7 '14 at 7:49





                      @peterph Indeed, but then you're restricted in the naming of the target directory

                      – mjturner
                      May 7 '14 at 7:49











                      5














                      cd aaa
                      pax -rw deep/sea/blob.psd ../bbb


                      If you don't have pax (it's mandated by POSIX, as a standard replacement of cpio and tar which had too many incompatibilities to standardize), use cpio -p or tar -cf - … | tar -xf - instead.






                      share|improve this answer



























                        5














                        cd aaa
                        pax -rw deep/sea/blob.psd ../bbb


                        If you don't have pax (it's mandated by POSIX, as a standard replacement of cpio and tar which had too many incompatibilities to standardize), use cpio -p or tar -cf - … | tar -xf - instead.






                        share|improve this answer

























                          5












                          5








                          5







                          cd aaa
                          pax -rw deep/sea/blob.psd ../bbb


                          If you don't have pax (it's mandated by POSIX, as a standard replacement of cpio and tar which had too many incompatibilities to standardize), use cpio -p or tar -cf - … | tar -xf - instead.






                          share|improve this answer













                          cd aaa
                          pax -rw deep/sea/blob.psd ../bbb


                          If you don't have pax (it's mandated by POSIX, as a standard replacement of cpio and tar which had too many incompatibilities to standardize), use cpio -p or tar -cf - … | tar -xf - instead.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jun 28 '12 at 0:43









                          GillesGilles

                          544k12811031620




                          544k12811031620



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • 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%2funix.stackexchange.com%2fquestions%2f41770%2fhow-can-i-copy-a-file-and-create-the-target-directories-at-the-same-time%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

                              How to check contact read email or not when send email to Individual?

                              Bahrain

                              Postfix configuration issue with fips on centos 7; mailgun relay