Pscp Usage Details Win and Linux File Transfer tools, pscp Usage Details

Source: Internet
Author: User
Tags pscp

Pscp Usage Details Win and Linux File Transfer tools, pscp Usage Details
Pscp Usage Details:
Pscp is a remote file transfer tool included in the putty installation package. It is a very common tool for transferring files between windows and linux systems. It is used in a similar way as scp in linux, here we will introduce some detailed usage methods.

PSCP: http://download.csdn.net/detail/doiido/8442599
Version: Release 0.60

Syntax:
Pscp [options] [user @] host: source target
Pscp [options] source [source...] [user @] host
Pscp [options]-ls user @ host: filespec

Common options:
-L: connect with the specified user
-P: the source file attributes are retained during transmission.
-P: Specifies the connection port (22 by default)
-Pw: password of the logon user (displayed)
-Q: No prompt message is displayed during transmission.
-R: recursively copy the entire directory
-V: a message is displayed during transmission.
-V: print the version information and exit.

Other options:
-1/-2: force the specified ssh Version
-4/-6: Force IPv4 or IPv6
-Agent: Use Pageant
-Noagent: Do not use Pageant
-Batch: Disable all interaction prompts.
-C: Use Compression
-I: Specifies the private key file required for authentication.
-Load: load the saved session settings.
-Pgpfp: print the PGP key fingerprint and exit.
-Scp: force use of SCP Protocol
-Sftp: force use of the SFTP protocol
-Unsafe: Allows wildcards (dangerous) on the server)


Usage:

Start with "run". In the DOS command environment, switch to the directory where pscp.exe is located, and then call

It is recommended that pscp.exe be placed in C: \ WINDOWS \ system32, and then can be called anywhere



Note: pscp uses the Windows login user name, so you must specify the Linux user name.


Common scenarios
Copy local files to a remote server
Copy files in the local directory and directory to the remote server
Copy files from remote server to local
Copy the directory in the remote server and the files in the directory to the local device.


Instance:
1. Copy local files to a remote server
Format: pscp local_file user @ ip:/remote_dir

Use dodousers to upload the doiido.txt file under the D Drive to the/doiido/directory of the linux host whose IP address is 192.168.100.250
Pscp-l dodo D: \ doiido.txt 192.168.100.250:/doiido
Dodo@192.168.100.250:/doiido pscp D: \ doiido.txt

Note: <1> the preceding two statements have the same effect.
<2> "-l dodo" must be before file



2. Copy files in the local directory and directory to the remote server

Format: pscp local_dir user @ ip:/remote_dir


Use the dodo user to upload the hello directory under drive D to the/doiido/directory of the linux host whose IP address is 192.168.100.250.
Pscp-r D: \ hello dodo@192.168.100.250:/doiido


3. Copy files from the remote server to the local device
Format: pscp user @ ip:/file \ local_dir

Use the dodo user to save the file test. SQL IN THE/doiido directory on the Linux host to the local device.
Pscp dodo@192.168.100.250:/doiido/test. SQL D: \ hello \ test. SQL


4. Copy files from directories and directories on the remote server to the local machine.
Format: pscp-r user @ ip:/remote_dir \ local_dir

Use the dodo user to save the/doiido directory and files in the directory on the Linux host to the local
Dodo@192.168.100.250:/doiido/hello1 D: \ hello2

In this way, the hello1 directory will be saved under the hello2 directory.
 

5. Use in script
Transfer all content under the Local FileUpload directory to the remote linux Server/doiido directory, as shown below:
(1 copy pscp.exe to the same directory of FileUpload
(2) create a new doiido file and end it with bat, that is, doiido. bat
(3) The file content is as follows:
@ ECHO Now begin to upload file
@ Pscp-r FileUpload dodo@192.168.100.250:/doiido
@ PAUSE

(4) Place the file to be uploaded to the FileUpload directory and double-click doiido. bat.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.