Home > OS >  SFTP get (download) can be specified after downloading the file name
SFTP get (download) can be specified after downloading the file name

Time:09-18

Scene: the distal on Linux/home/work/test/file1. TXT downloaded to the local user/test/downloads/
The following

The first CD/home/work/test to Linux specified directory
Then the LCD user/test/downloads/define local directory

The get file1. TXT

Could you tell me if you want to specify download file name is file2. TXT what should I do?

Try to use the following command failed, download success but the file name didn't change
The get file1. TXT file2. TXT
The get file1. TXT - o file2. TXT

In the same way if you get the put (upload) after you can also specify the upload file name?
Pray god to solve!

CodePudding user response:

Man SFTP:

Get/- afPpr remote - path/local - path
Retrieve the remote - path and store it on the local machine. If the local path name is not specified, it is given the same name it has on
The remote machine. Remote - path may contain glob (3) characters and may match multiple files. If it does and the local - path is specified, then the
Local - the path must specify a directory.

If the -a flag is specified, then attempt to resume partial transfers of existing files. Note that resumption assumes that any partial copy
Of the local file matches the remote copy. If the remote file contents differ from the partial local copy then the resultant file is likely
To be corrupt.

If the -f flag is specified, then the fsync (2) will be called after the file transfer has completed to flush the file to disk.

If either the -p or the -p flag is specified, then the full file permissions and access times are copied too.

If the -r flag is specified then directories will be copied recursively. Note that SFTP does not follow -- symbolic links the when performing
Recursive transfers.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Put [- afPpr] local - path/remote - path
Upload the local - path and store it on the remote machine. If the remote path name is not specified, it is given the same name it has on the
The local machine. The local - path may contain glob (3) characters and may match multiple files. If it does and remote - path is specified, then the
Remote - the path must specify a directory.

If the -a flag is specified, then attempt to resume partial transfers of existing files. Note that resumption assumes that any partial copy
Of the remote file matches the local copy. If the local file contents differ from the remote local copy then the resultant file is likely
To be corrupt.

If the -f flag is specified, then a request will be sent to the server to call fsync (2) after the file has had been transferred. Note that this
Is only supported by the servers that implement the "[email protected]" is the extension.

If either the -p or the -p flag is specified, then the full file permissions and access times are copied too.

If the -r flag is specified then directories will be copied recursively. Note that SFTP does not follow -- symbolic links the when performing
Recursive transfers.

CodePudding user response:

Look not specified file name, can only be specified directory;
  • Related