Method 1, Transfer file demonstration (start the receiving command first)
It is quite convenient to use NC to transfer files, because you don’t use scp and rsync to enter passwords.
Send a rpm file on machine A to machine B
Pay attention to the operation order. The receiver first listens to the port, and the sender sends data to the port of the machine where the receiver is located.
Step 1: Start a listening on machine B to receive files, the format is as follows
It means to write all the data received on port 9995 into the file file (the file name is available here)
nc -l port >file
nc -l 9995 >