We all have been using chat service since a long time. We are familiar with Google chat, Hangout, Facebook chat, Whatsapp, Hike and several other application and integrated chat services. Do you know Linux nc command can make your Linux box a chat server with just one line of command.
What is nc command in Linux and what it does?
nc is the depreciation of Linux netcat command. The nc utility is often referred as Swiss army knife based upon the number of its built-in capabilities. It is used as debugging tool, investigation tool, reading and writing to network connection using TCP/UDP, DNS forward/reverse checking.
It is prominently used for port scanning, file transferring, backdoor and port listening. nc has the ability to use any local unused port and any local network source address.
Use nc command (On Server with IP address: 192.168.0.7) to create a command line messaging server instantly.
$ nc -l -vv -p 11119
Explanation of the above command switches.
- -v : means Verbose
- -vv : more verbose
- -p : The local port Number
You may replace 11119 with any other local port number.
Next on the client machine (IP address: 192.168.0.15) run the following command to initialize chat session to machine (where messaging server is running).
$ nc 192.168.0.7 11119
Note: You can terminate chat session by hitting ctrl+c key and also nc chat is one-to-one service.