Use the NC command in Linux for File Transfer

Source: Internet
Author: User

NC is a powerful command that transfers files between two Linux Hosts. If there are two hosts a and B with IP addresses 192.168.0.1 and 192.168.0.2 respectively, and I need to transmit a file test1.in from host B to host B, the procedure is as follows:

On host:NC-l 25> test1.out
On host B:NC 192.168.0.1 <test1.in

Text
After the device is transmitted, the system automatically disconnects the device. From the above, it is actually a very simple server/client mode. The server enables the listening port and redirects it to
In the test1.out file, wait for the client to connect. The client actively connects to the host, establishes a socket connection with it, And then redirects the transmitted file to the data stream.

Note that the host listening port must be an opened port and can be configured by viewing iptables.

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.