SCP - “not a directory” - What am I doing wrong?












5














On my remote server I have a file named .bash_profile, that file has nothing inside.
I wish to copy a local copy (with something inside) to the remote destination. (overwrite)



So I do:



scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile


I get:




scp: /home/bleble/.bash_profile: Not a directory




I know it's not a directory.



What am I doing wrong?










share|improve this question
























  • If you are coming here from google, verify that the target directory actually exists.
    – Charles Holbrow
    Apr 10 at 1:44
















5














On my remote server I have a file named .bash_profile, that file has nothing inside.
I wish to copy a local copy (with something inside) to the remote destination. (overwrite)



So I do:



scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile


I get:




scp: /home/bleble/.bash_profile: Not a directory




I know it's not a directory.



What am I doing wrong?










share|improve this question
























  • If you are coming here from google, verify that the target directory actually exists.
    – Charles Holbrow
    Apr 10 at 1:44














5












5








5


2





On my remote server I have a file named .bash_profile, that file has nothing inside.
I wish to copy a local copy (with something inside) to the remote destination. (overwrite)



So I do:



scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile


I get:




scp: /home/bleble/.bash_profile: Not a directory




I know it's not a directory.



What am I doing wrong?










share|improve this question















On my remote server I have a file named .bash_profile, that file has nothing inside.
I wish to copy a local copy (with something inside) to the remote destination. (overwrite)



So I do:



scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile


I get:




scp: /home/bleble/.bash_profile: Not a directory




I know it's not a directory.



What am I doing wrong?







linux ssh scp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 16 '14 at 15:35









terdon

41.1k885135




41.1k885135










asked Jan 16 '14 at 15:33









MEM

46251224




46251224












  • If you are coming here from google, verify that the target directory actually exists.
    – Charles Holbrow
    Apr 10 at 1:44


















  • If you are coming here from google, verify that the target directory actually exists.
    – Charles Holbrow
    Apr 10 at 1:44
















If you are coming here from google, verify that the target directory actually exists.
– Charles Holbrow
Apr 10 at 1:44




If you are coming here from google, verify that the target directory actually exists.
– Charles Holbrow
Apr 10 at 1:44










2 Answers
2






active

oldest

votes


















6














Since you want to copy the file with the same name, you don't need to specify a target name:



scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/


Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.






share|improve this answer





















  • A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
    – Billy McCloskey
    Jan 16 '14 at 15:47












  • @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
    – terdon
    Jan 16 '14 at 15:50












  • Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
    – Billy McCloskey
    Jan 16 '14 at 15:57





















0














For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed



scp selnpcgwnx1001:~ file1 file2


instead of the correct



scp file1 file2 selnpcgwnx1001:~


For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.






share|improve this answer





















    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%2f702608%2fscp-not-a-directory-what-am-i-doing-wrong%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









    6














    Since you want to copy the file with the same name, you don't need to specify a target name:



    scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/


    Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.






    share|improve this answer





















    • A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
      – Billy McCloskey
      Jan 16 '14 at 15:47












    • @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
      – terdon
      Jan 16 '14 at 15:50












    • Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
      – Billy McCloskey
      Jan 16 '14 at 15:57


















    6














    Since you want to copy the file with the same name, you don't need to specify a target name:



    scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/


    Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.






    share|improve this answer





















    • A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
      – Billy McCloskey
      Jan 16 '14 at 15:47












    • @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
      – terdon
      Jan 16 '14 at 15:50












    • Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
      – Billy McCloskey
      Jan 16 '14 at 15:57
















    6












    6








    6






    Since you want to copy the file with the same name, you don't need to specify a target name:



    scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/


    Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.






    share|improve this answer












    Since you want to copy the file with the same name, you don't need to specify a target name:



    scp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/


    Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 16 '14 at 15:37









    terdon

    41.1k885135




    41.1k885135












    • A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
      – Billy McCloskey
      Jan 16 '14 at 15:47












    • @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
      – terdon
      Jan 16 '14 at 15:50












    • Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
      – Billy McCloskey
      Jan 16 '14 at 15:57




















    • A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
      – Billy McCloskey
      Jan 16 '14 at 15:47












    • @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
      – terdon
      Jan 16 '14 at 15:50












    • Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
      – Billy McCloskey
      Jan 16 '14 at 15:57


















    A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
    – Billy McCloskey
    Jan 16 '14 at 15:47






    A similar command works for me, so this may be implementation dependent? scp fred/.bashrc whmcclos@localhost:fred/.bashrc copied just fine. Works same on both OSX (BSD) and Ubuntu (also BSD).
    – Billy McCloskey
    Jan 16 '14 at 15:47














    @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
    – terdon
    Jan 16 '14 at 15:50






    @BillMcCloskey same here but I guess the OP must have a different implementation. It's the only reason for the described behavior I can think of. Perhaps it was just a typo and the OP ran cp ~/path/bla/ble/.bash_profile username@host.com:/home/bleble/.bash_profile/.
    – terdon
    Jan 16 '14 at 15:50














    Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
    – Billy McCloskey
    Jan 16 '14 at 15:57






    Yeah, I'm thinking typo as well, because I'd expect this to work as was tried. Oh - that was OSX 10.9.1 and Ubuntu 12.04.
    – Billy McCloskey
    Jan 16 '14 at 15:57















    0














    For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed



    scp selnpcgwnx1001:~ file1 file2


    instead of the correct



    scp file1 file2 selnpcgwnx1001:~


    For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.






    share|improve this answer


























      0














      For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed



      scp selnpcgwnx1001:~ file1 file2


      instead of the correct



      scp file1 file2 selnpcgwnx1001:~


      For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.






      share|improve this answer
























        0












        0








        0






        For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed



        scp selnpcgwnx1001:~ file1 file2


        instead of the correct



        scp file1 file2 selnpcgwnx1001:~


        For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.






        share|improve this answer












        For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed



        scp selnpcgwnx1001:~ file1 file2


        instead of the correct



        scp file1 file2 selnpcgwnx1001:~


        For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 10 at 9:33









        Godsmith

        260137




        260137






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f702608%2fscp-not-a-directory-what-am-i-doing-wrong%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

            If I really need a card on my start hand, how many mulligans make sense? [duplicate]

            Alcedinidae

            Can an atomic nucleus contain both particles and antiparticles? [duplicate]