Sunday, 13 March 2016

Linux Hacks 2: Turn Terminal Into a Chat Client

In case you don't wont to leave any history of your terminal chat. Read the previous article about leaving no history on the terminal.


For turning your terminal into a chat client. You need to two commands, the first one is executed on one pc and the other on the pc with which u wish to communicate.



nc -l 54321 

Execute this command on the first pc. Here nc stands for netcat, while the option -l tells the computer to act as a listener on the port which we specify. So in this case the first pc will be listening for communication on this 54321. 

Use a large number as a port number. Many of the lower number are reserved such as 80 for http. Also ensure that there isn't any application using this port number. In case you don't have knowledge of port numbers use 54321 or 55555 or any other five digit number less than 65535.

nc 198.168.4.45 54321
On the second pc specify the same port number and the ip address of the first computer. Your chat client is now ready.
To exit or terminate this just kill the process by pressing Ctrl+C.



No comments:

Post a Comment