how can i know which program is listening on a specific port...

for example:

if my program listens on port 9000, and another is listening on port 9001, how can i list them...


thanks in advanced.