netstat -p, missing PID/program name


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users netstat -p, missing PID/program name
# 1  
Old 04-23-2009
netstat -p, missing PID/program name

I have a netstat command set up with awk to show which ports my box is listening on. The -p switch shows the PID/program name, too, which ordinarily would be very handy. However, several entries show up as just "-" for the program name which makes it hard to identify what is keeping the port open. It is possible to find this out by issuing a separate lsof command, but what I want to know is why the program name is omitted in the first place in the netstat output and how this can be avoided. I'm guessing there may be different ways to instantiate processes that could help with avoiding this problem.

I really want to be able to see what programs are using my ports at a single glance.
# 2  
Old 04-23-2009
try your netstat command with the '-l' option in addition to '-p'. It will show listening processes only. the '-' you are getting is probably for established connections, which aren't listening. I usually run 'netstat -tunlp' for the best results.
# 3  
Old 04-23-2009
This has no effect on missing process names.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PID missing on my File.

I have 3 files namely run1.cmd, run2.cmd & run3.cmd more run1.cmd cd /tmp/scripts/app1/ nohup ./startserver.sh & more run2.cmd cd /tmp/scripts/app2/ nohup ./startserver.sh & more run3.cmd cd /tmp/scripts/app3/ nohup ./startserver.sh & These scripts are kept on my ansible... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. AIX

How to grep PID and program name from netstat in AIX?

Hi All, I am using netstat on AIX to grep info on all open connections. However, unlike on Linux(Centos), I do not get the PID and program name using netstat on AIX. I need this info to be clubbed along with the information retrieved using netstat version of AIX. Is there a way this can be... (1 Reply)
Discussion started by: Vipin Batra
1 Replies

3. HP-UX

PID and program name from netstat.

Hello All, I am using netstat on HP-UX to retrieve the established network connections on my host. Can anyone please confirm how can I retrieve the PID and program name as well for these connections? These are available from the netstat version on Windows but I don't see PID and program name to... (10 Replies)
Discussion started by: Happy83
10 Replies

4. Red Hat

Yum - resolving missing dependencies that are not missing

I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following: sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm Loaded plugins: fastestmirror Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies

5. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

6. Solaris

Default route ( netstat -nrv ) is removed/missing after platform patch

After running a script for Platform Patch, the default route is removed from netstat -nrv. The machine does not reboot after Platform Patch. The script does not have any command to remove default route as shown below... route del default gw <IP> I am wondering, how is the defaut route... (10 Replies)
Discussion started by: frintocf
10 Replies

7. Programming

getting the pid of another C program with unix calls

I have a C program called server.c which is supposed to get the pid of another program, client.c, and send a signal to it, but I'm not sure how to do it. Server.c is first run in the background then client is run in the foreground. I tried pid_t pid; pid = system("pidof -s client.c");... (3 Replies)
Discussion started by: busdude
3 Replies

8. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

9. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

10. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies
Login or Register to Ask a Question