8

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?

2
  • 1
    Can you provide us the code for this? I shouldn't need to be digging it up. Commented Jul 21, 2014 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
    Commented Jul 21, 2014 at 16:26

1 Answer 1

21

-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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.