6

I'm using the library sshj for sending an scp command. It uses the option -f for downloading from a server to another. I can't find the -f option in the man.

What is the signification of -f in an scp command?

approxiblue
  • 6,982
  • 16
  • 51
  • 59
Clepshydre
  • 73
  • 1
  • 6
  • 1
    Can you provide us the code for this? I shouldn't need to be digging it up. – But I'm Not A Wrapper Class Jul 21 '14 at 16:18
  • 2
    scp has -f and -t options, but they're not intended for end-user use. IIRC, scp the client application requests ssh-server-side invocations of scp with these options to send and receive individual files. (Note, I've made no attempt to verify my recollection.) – sjnarv Jul 21 '14 at 16:26

1 Answers1

18

-f and -t are undocumented switches which tell the remote scp to send or prepare to receive a file or files from the local scp.

This site explains it in slightly more detail in section 3.8.1. scp1 Details:

That copy is invoked with the undocumented switches -t and -f (for "to" and "from"), putting it into SCP1 server mode. This next table shows some examples; Figure 3-6 shows the details.

This client scp command:      Runs this remote command:
scp foo server:bar            scp -t bar
scp server:bar foo            scp -f bar
scp *.txt server:dir          scp -d -t dir
Andrew Stubbs
  • 4,322
  • 3
  • 29
  • 48