Skip to Main Content
How Linux Works
book

How Linux Works

by Brian Ward
May 2004
Beginner content levelBeginner
368 pages
8h 44m
English
No Starch Press
Content preview from How Linux Works

Diagnostic Tools

netstat is one of the most basic network service debugging tools, telling you what ports are open and whether any programs are listening on ports. For example, if you want to view all open TCP ports, run this command:

netstat -t

Table 6-2 lists the netstat options.

Table 6-2. netstat Options

Option

Description

-t

Prints TCP port information

-u

Prints UDP port information

-l

Prints listening ports

-a

Prints every active port

-n

Disables name lookups (useful if DNS isn't working)

Being able to list open and listening ports is good, but our good old friend lsof can go one step further.

lsof

In Finding Open Files with lsof you saw how lsof can track open files, but lsof can also list the programs currently using or listening to ports. For a complete ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

How Linux Works, 2nd Edition

How Linux Works, 2nd Edition

Brian Ward
Linux in a Nutshell, 6th Edition

Linux in a Nutshell, 6th Edition

Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
Linux in Action

Linux in Action

David Clinton
Linux Under the Hood

Linux Under the Hood

Sander van Vugt

Publisher Resources

ISBN: 9781593270353Errata