Use PSCP order to achieve Linux files from local and remote Windows pass each other

Example usage:

  • Transfer local files to a remote Windows Linux
pscp D:\test\test.txt [email protected]:/usr/local

The test.txt file in the test directory of the local drive D uploaded to the remote server usr 123.123.123.123 / local directory, logged in as root, Enter need to enter the root password

  • Pull the remote Linux files to a local Windows
pscp [email protected]:/usr/local/test.txt D:\test\

The test.txt file in the remote server usr 123.123.123.123 / local directory, logged in as root, copy to the test directory of the local D drive, you need to enter the root password Enter

pscp command Detailed

grammar:

pscp [options] [user@]host:source target
pscp [options] source [source…] [user@]host
pscp [options] -ls user@host:filespec

Common options:
the -l: connection with the specified user
-p: Keep source file attributes transmission
-P: Specifies the port connection (default 22)
-pw: Specifies the user's login password (shown)
-q: does not show transmission any tips news
-r: recursive copy the entire directory (directory copies)
-v: display the prompt message transmission
-V: print version information and exit

Other options:
-1 / -2: force the use of the specified version of ssh
-4 / -6: mandatory use IPv4 or IPv6
-agent: Use Pageant
-noagent: do not use Pageant
the -batch: disable all interactive prompts
-C: use compressed
- i: specifies the required certification private key file
-load: load a saved session settings
-pgpfp: Print PGP key fingerprints and exit
-scp: mandatory use SCP protocol
-sftp: mandatory use SFTP protocol
-unsafe: allow wildcard server-side (dangerous of)

Released eight original articles · won praise 6 · views 353

Guess you like

Origin blog.csdn.net/lzycug/article/details/104915431