Getting error while using sftp (get: Invalid Flag -r)
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
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.
|
show 2 more comments
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
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 forsftp
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 ofsftp
? It may be that only the-P
flag is implemented for theget
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
|
show 2 more comments
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
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
rhel remote file-copy sftp
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 forsftp
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 ofsftp
? It may be that only the-P
flag is implemented for theget
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
|
show 2 more comments
Does your man page forsftp
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 ofsftp
? It may be that only the-P
flag is implemented for theget
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
|
show 2 more comments
1 Answer
1
active
oldest
votes
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.
Thanks for the formatting Jeff, how did you do that?
– Michael Prokopec
Nov 17 '18 at 22:25
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Thanks for the formatting Jeff, how did you do that?
– Michael Prokopec
Nov 17 '18 at 22:25
add a comment |
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.
Thanks for the formatting Jeff, how did you do that?
– Michael Prokopec
Nov 17 '18 at 22:25
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 theget
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