Network – Who's listening?

When working with network applications, it comes in handy to be able to see open ports and connections and to be able to interact with ports on different hosts for testing purposes. In this section, we will be looking at some basic commands for networking and in what situations they might come in handy.

The first command is netstat:

netstat -plnt
Network – Who's listening?

This will show all open ports on our host. You can see here that we only have one open port on a default Ubuntu desktop installation, which is port 53. We can look this up in the special file /etc/services. This file contains all basic port numbers for programs and protocols. We ...

Get Working with Linux – Quick Hacks for the Command Line now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.