Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any command on Linux available to show which udp/tcp ports are opened by a certain application on Linux. I don't mean netstat, because thats's only showing the open ports.

Presumably, this is a daemon that runs and studying the connections that are coming from some application.

share|improve this question
1  
Can you clarify? You want to show the open ports belonging to an application - netstat can do this, with the -p switch –  Paul Jan 31 '12 at 13:05
    
Your question is confusing, especially "[...]show which udp/tcp ports are opened by a certain application on Linux. I don't mean netstat, because thats's only showing the open ports." Can you clarify ? –  Karolos Jan 31 '12 at 13:35
    
Yeah, but I am interested in the ports an application is trying to open (also the onces that are bounced off by some firewall) –  Willem Jan 31 '12 at 13:46

2 Answers 2

up vote 2 down vote accepted

You can use command ss is used to dump socket statistics and command nc arbitrary TCP and UDP connections and listens

Basically Most linux distribution not shipping ss

share|improve this answer
    
Thanks I will try that. Can it also monitor the statistics, or does it simply read out the statistics of the sockets ? –  Willem Jan 31 '12 at 13:45

Try lsof -i. You might have to grep for the pid you want too look at.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.