Copy Files from machine to machine with netcat

To move files from one machine to another, one method is to use netcat.
On the source machine:

sudo apt-get install netcat-traditional
sudo update-alternatives --set nc /bin/nc.traditional

Type the next command but do NOT press Enter yet:

tar cz -C/home-path item-or-directory|nc -l -p 8888 -w 10


tar is an utility for packing files
cz creates such a packed file ("tarball")
The tarball is compressed using the GZip algorithm to lower the file size.
-C/home your-username changes the working directory to /home and puts the your-username folder in the tarball
nc (netcat) is used for setting up connections between machines easily
-l: Listening mode, allows other machines to connect to the current machine
-p 8888: Listens on port 8888 (randomly chosen number, it could be any other number higher than 1024 as well)
-w 10: quit netcat after 10 seconds silence. You must connect to this source computer within this time.
On the target computer (nettop). To add the files to the target machine, type but do NOT run:

nc 8888|tar xzp -C/home is the IP address of the source computer. To get its IP address, run: ifconfig on the source machine
8888 is the port number as entered on the source machine
xzp: extracts the GZip-compressed tarball while preserving permissions.
-C/home: extracts the your-username folder to /home/your-username
Optionally, add the -v switch to the tar command for verbose extraction, so you can get an idea of the progress. This could slow down the copy process because every file has to be printed.

Go to the source computer, press Enter to run the server command.
Go to your nettop and press Enter to run the client command.