How to Transfer Files Between Two Computers using nc and pv Commands

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

13 Responses

  1. David says:

    Any idea how to put netcat to background via nohup ? I was trying to achieve this but without sucess.

  2. Daniel PC says:

    From man pages:

    -l Used to specify that nc should listen for an incoming connection rather than initiate a connection to a remote host. It is an error
    to use this option in conjunction with the -p, -s, or -z options. Additionally, any timeouts specified with the -w option are
    ignored.

    In fact, trying nc command with -l -p, it respond with an error.

    • Ravi Saive says:

      @Daniel,

      I always use -l switch with nc command to initiate a connection to remote host but I never received any error, could you please share the error that you received so that I can have better solution to this..

  3. David in Munich says:

    @Ravi

    why is this any better than scp?

    • Ravi Saive says:

      @David,

      As I stated it’s not recommended over public network as the data transfer is insecure, it’s best suits for internal network only and there isn’t any good feature other than transfer speed..

      • Jj says:

        Any good feature? remote does not need to have configured ssh.. No logins no passwords.. You can stream only one file for your colleague in office very quick just tell him ip and port… In the office this approach has more advantages than sharing your whole /home with ssh :)

        • Ravi Saive says:

          @Jj,

          Yes, no need of SSH configured on client nor any username/password its just works on TCP port, and yes it is very useful in sharing files in no time without any clients..

  4. Kamran says:

    Great tutorial. One question though, what if I don’t want to compress. I would use cat filename at sending machine. what will I put on recieving end?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?