Getting error while using sftp (get: Invalid Flag -r)












1















I want to copy a few folders from Server A (/aaa/bbb/ccc/) to Server B (/xxx/yyy/zzz/), considering Server A is source and Server B is destination.



There are multiple folders in ccc/ which need to be copied inside zzz/.



I tried using sftp which is only available option for me and should be executed from destination not from source and tried to connect source



In Console (SERVER B) :

[user zzz]$ sftp hostname.domain.com

------ Connected -------

sftp> get -r /aaa/bbb/ccc/


It returns:




get : Invalid flag -r




Server we are using is RedHat Enterprise, Need to copy the folders.



EDIT 1.



sftp> get -r / aaa / bbb / ccc /
get: Invalid flag -r
sftp> Write failed: Broken pipe

sftp> version
SFTP protocol version 3









share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

    – steve
    Sep 22 '17 at 21:19











  • You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

    – Scott
    Sep 22 '17 at 21:43











  • What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

    – Kusalananda
    Sep 23 '17 at 20:28













  • @Scott Yes My Mistake, it should be copied into zzz/

    – Rishabh Prasad
    Sep 24 '17 at 10:24











  • @steve It returned nothing when I ran man sftp | grep "get "

    – Rishabh Prasad
    Sep 24 '17 at 11:17


















1















I want to copy a few folders from Server A (/aaa/bbb/ccc/) to Server B (/xxx/yyy/zzz/), considering Server A is source and Server B is destination.



There are multiple folders in ccc/ which need to be copied inside zzz/.



I tried using sftp which is only available option for me and should be executed from destination not from source and tried to connect source



In Console (SERVER B) :

[user zzz]$ sftp hostname.domain.com

------ Connected -------

sftp> get -r /aaa/bbb/ccc/


It returns:




get : Invalid flag -r




Server we are using is RedHat Enterprise, Need to copy the folders.



EDIT 1.



sftp> get -r / aaa / bbb / ccc /
get: Invalid flag -r
sftp> Write failed: Broken pipe

sftp> version
SFTP protocol version 3









share|improve this question
















bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

    – steve
    Sep 22 '17 at 21:19











  • You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

    – Scott
    Sep 22 '17 at 21:43











  • What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

    – Kusalananda
    Sep 23 '17 at 20:28













  • @Scott Yes My Mistake, it should be copied into zzz/

    – Rishabh Prasad
    Sep 24 '17 at 10:24











  • @steve It returned nothing when I ran man sftp | grep "get "

    – Rishabh Prasad
    Sep 24 '17 at 11:17
















1












1








1


0






I want to copy a few folders from Server A (/aaa/bbb/ccc/) to Server B (/xxx/yyy/zzz/), considering Server A is source and Server B is destination.



There are multiple folders in ccc/ which need to be copied inside zzz/.



I tried using sftp which is only available option for me and should be executed from destination not from source and tried to connect source



In Console (SERVER B) :

[user zzz]$ sftp hostname.domain.com

------ Connected -------

sftp> get -r /aaa/bbb/ccc/


It returns:




get : Invalid flag -r




Server we are using is RedHat Enterprise, Need to copy the folders.



EDIT 1.



sftp> get -r / aaa / bbb / ccc /
get: Invalid flag -r
sftp> Write failed: Broken pipe

sftp> version
SFTP protocol version 3









share|improve this question
















I want to copy a few folders from Server A (/aaa/bbb/ccc/) to Server B (/xxx/yyy/zzz/), considering Server A is source and Server B is destination.



There are multiple folders in ccc/ which need to be copied inside zzz/.



I tried using sftp which is only available option for me and should be executed from destination not from source and tried to connect source



In Console (SERVER B) :

[user zzz]$ sftp hostname.domain.com

------ Connected -------

sftp> get -r /aaa/bbb/ccc/


It returns:




get : Invalid flag -r




Server we are using is RedHat Enterprise, Need to copy the folders.



EDIT 1.



sftp> get -r / aaa / bbb / ccc /
get: Invalid flag -r
sftp> Write failed: Broken pipe

sftp> version
SFTP protocol version 3






rhel remote file-copy sftp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 '18 at 1:37









Torxed

1,24441735




1,24441735










asked Sep 22 '17 at 21:04









Rishabh PrasadRishabh Prasad

62




62





bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

    – steve
    Sep 22 '17 at 21:19











  • You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

    – Scott
    Sep 22 '17 at 21:43











  • What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

    – Kusalananda
    Sep 23 '17 at 20:28













  • @Scott Yes My Mistake, it should be copied into zzz/

    – Rishabh Prasad
    Sep 24 '17 at 10:24











  • @steve It returned nothing when I ran man sftp | grep "get "

    – Rishabh Prasad
    Sep 24 '17 at 11:17





















  • Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

    – steve
    Sep 22 '17 at 21:19











  • You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

    – Scott
    Sep 22 '17 at 21:43











  • What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

    – Kusalananda
    Sep 23 '17 at 20:28













  • @Scott Yes My Mistake, it should be copied into zzz/

    – Rishabh Prasad
    Sep 24 '17 at 10:24











  • @steve It returned nothing when I ran man sftp | grep "get "

    – Rishabh Prasad
    Sep 24 '17 at 11:17



















Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

– steve
Sep 22 '17 at 21:19





Does your man page for sftp suggest that '-r' is a valid option ? man sftp | grep "get "

– steve
Sep 22 '17 at 21:19













You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

– Scott
Sep 22 '17 at 21:43





You say, “There are multiple folders in ccc/ which need to be copied inside ddd/.” Do you mean, “There are multiple folders in ccc/ which need to be copied into zzz/.”?

– Scott
Sep 22 '17 at 21:43













What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

– Kusalananda
Sep 23 '17 at 20:28







What is your version of sftp? It may be that only the -P flag is implemented for the get command in the version you're using. Check your manual.

– Kusalananda
Sep 23 '17 at 20:28















@Scott Yes My Mistake, it should be copied into zzz/

– Rishabh Prasad
Sep 24 '17 at 10:24





@Scott Yes My Mistake, it should be copied into zzz/

– Rishabh Prasad
Sep 24 '17 at 10:24













@steve It returned nothing when I ran man sftp | grep "get "

– Rishabh Prasad
Sep 24 '17 at 11:17







@steve It returned nothing when I ran man sftp | grep "get "

– Rishabh Prasad
Sep 24 '17 at 11:17












1 Answer
1






active

oldest

votes


















0














Use:



sftp -r server@address
sftp> get /dir/to/path/files/


You could also try wildcards to get this to work as well.



sftp> get /dir/to/path/files/*
sftp> get /dir/to/path/files/*. * #minus the space after the period.





share|improve this answer


























  • Thanks for the formatting Jeff, how did you do that?

    – Michael Prokopec
    Nov 17 '18 at 22:25











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%2f393910%2fgetting-error-while-using-sftp-get-invalid-flag-r%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Use:



sftp -r server@address
sftp> get /dir/to/path/files/


You could also try wildcards to get this to work as well.



sftp> get /dir/to/path/files/*
sftp> get /dir/to/path/files/*. * #minus the space after the period.





share|improve this answer


























  • Thanks for the formatting Jeff, how did you do that?

    – Michael Prokopec
    Nov 17 '18 at 22:25
















0














Use:



sftp -r server@address
sftp> get /dir/to/path/files/


You could also try wildcards to get this to work as well.



sftp> get /dir/to/path/files/*
sftp> get /dir/to/path/files/*. * #minus the space after the period.





share|improve this answer


























  • Thanks for the formatting Jeff, how did you do that?

    – Michael Prokopec
    Nov 17 '18 at 22:25














0












0








0







Use:



sftp -r server@address
sftp> get /dir/to/path/files/


You could also try wildcards to get this to work as well.



sftp> get /dir/to/path/files/*
sftp> get /dir/to/path/files/*. * #minus the space after the period.





share|improve this answer















Use:



sftp -r server@address
sftp> get /dir/to/path/files/


You could also try wildcards to get this to work as well.



sftp> get /dir/to/path/files/*
sftp> get /dir/to/path/files/*. * #minus the space after the period.






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 17 '18 at 22:15









Jeff Schaller

42.9k1159137




42.9k1159137










answered Nov 17 '18 at 20:31









Michael ProkopecMichael Prokopec

1,532218




1,532218













  • Thanks for the formatting Jeff, how did you do that?

    – Michael Prokopec
    Nov 17 '18 at 22:25



















  • Thanks for the formatting Jeff, how did you do that?

    – Michael Prokopec
    Nov 17 '18 at 22:25

















Thanks for the formatting Jeff, how did you do that?

– Michael Prokopec
Nov 17 '18 at 22:25





Thanks for the formatting Jeff, how did you do that?

– Michael Prokopec
Nov 17 '18 at 22:25


















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%2f393910%2fgetting-error-while-using-sftp-get-invalid-flag-r%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

Loup dans la culture

How to solve the problem of ntp “Unable to contact time server” from KDE?

ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux