Send Message to Another Computer via Terminal

Bismillah.

Sometimes in our work, we need to copy some text from one to another computer. We can use Netcat in the terminal instead installing some big application just for small needs. Netcat (nc) can be used to do some functions in TCP and UDP connection. You can see more detail in the manual.

man nc

In this example. I try to send some message from my office’s laptop with openSUSE installed (A) to my own laptop with Ubuntu installed (B). A and B is connected each other in the Local Area Network (LAN).

The first step is to see the IP address of A. We can use this command in the Terminal.

ifconfig
ifconfig
See IP address

We know that IP address is 192.168.1.23. Then we can start the receiver in A with this command. Use a port number that is not used by our computer system. I choose port number 1405.

nc -l 1405

Then in the B, use this command in the Konsole with the IP Address from A and port number we have chosen. Then start to send some text.

nc 192.168.1.23 1405
screenshot_20170111_222145
Computer B (Sender)
computer-a
Computer A (Receiver)

In the A you will receive some text you have sent from B. Then you could copy the text and use it for your needs. In my work, this way is very helpful. I usually use it to send site address, configuration text or some important text.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: