It is easy to use the utility netstat to list the active connections you have to your machine
provides the information. But often it is good to know which process/program the connection is to. Again netstat obliges
However, if like me you use 80 column xterms (or even one of the linux VTs in 80 column mode), then the long lines make the output less than easy reading. So using the “
cut” utility we can cut down the verbiage to what is important
netstat -tp | cut -c21-63,80-
I often like to use the “
--numeric-hosts” option to netstat too.
Another use of netstat is to show those programs that are listening for connections. This can help check if services have crashed, or whether you have unwelcome “services” running on your machine.
cut” can be used to trim the fat and keep the output manageable
netstat -tpl | cut -c21-36,56-63,80-
It is worth giving the man page a netstat a check, it is a very useful utility.