Transferring files between two computers over the Internet (netcat)

    A simple and very useful utility that can transmit data over a network.
    netcat (or nc) should be in any distribution. If it is not there, then it is posed as follows by the example of debian:
    apt-get install netcat

    The idea of ​​netcat is very simple: it simply redirects the data stream to the port of the network device, and at the other end the stream is redirected to a file.

    use it like this:

    on the server side
    nc -l -p 3333 > file.txt

    on the client side: The -q 0 switch is needed so that netcat shuts down immediately after sending, you can send files by first packing them: on the server side on the client side:
    cat file.txt | nc -q 0 3333

    nc -l -p 3333 | tar xv

    tar cv * | nc -q 0 3333

    Also popular now: