javascpsshj

What is the signification of -f in scp command?


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?


Solution

  • -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