Sponsored Content
Operating Systems Solaris How to check process ID from netstat? Post 302307542 by seanovision on Wednesday 15th of April 2009 05:11:03 PM
Old 04-15-2009
I think I'm running into the same situation as KhawHL. I need to tie a port number that a process is listening on and identify that process.

netstat gives me ports that it's listening on, and I see suspicious ports.

ps -ef gives me process names and their PIDs.

lsof doesn't work on Sol9.

Is there another way to map a PID to port on Sol9?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

process check

does anyone know an easy way that at the beginning of your script you check to see if that process is already running? I think it would have something to do with ps but I may be making it more complicated than it has to be. If you have a script run say, every half hour, you would want to check and... (13 Replies)
Discussion started by: k@ssidy
13 Replies

2. UNIX for Advanced & Expert Users

Check the process

I want to find the pid ( by ps ) that has already run over 30 seconds , I know ps only show the minute/hour . eg. the start time of the below process are 15:19 / 15:20 , but I don't know the exact time ( in term of "second" ) it start to run ( I only know the hour and minute ) , if I want to... (2 Replies)
Discussion started by: ust
2 Replies

3. Shell Programming and Scripting

check the process

how to kill the process that are idle over 30 minutes ? thx (2 Replies)
Discussion started by: ust
2 Replies

4. UNIX for Dummies Questions & Answers

Check the process

Except the command "top" , is there other function / tool is used to check the process status in the system like 1. what process are running ? 2. how the CPU are allocating ? 3. how many swap is using ? 4. " Thx. (1 Reply)
Discussion started by: ust
1 Replies

5. Shell Programming and Scripting

check process running

I have this script: ------------------------------------------------------- #!/bin/ksh # if ] || ] then echo "Executing main_load.sh script" /usr1/psc_load/jobs/cron/main_load.sh "ods" else echo "File not found, do nothing" fi exit 0 ... (4 Replies)
Discussion started by: rose1207
4 Replies

6. Shell Programming and Scripting

Check process

Hi.. I have this code which tells me that if a process is running or not. Actually someone on this forum help me to do it. :) But now If i want to check if the process is not running for more than 10 minutes. Does anyone know the code or syntax that checks if a process is not running for some... (1 Reply)
Discussion started by: kanexxx
1 Replies

7. Programming

How do I check if a process is running in C

How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that? Thanks, (1 Reply)
Discussion started by: cprogdude
1 Replies

8. UNIX for Dummies Questions & Answers

How a process can check if a particular process is running on different machine?

I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Discussion started by: saurabhnsit2001
2 Replies

9. Shell Programming and Scripting

How to check empty port using netstat?

Hi, How to check empty port using netstat please help Thanks Ashfaque (3 Replies)
Discussion started by: ashfaque
3 Replies

10. UNIX for Beginners Questions & Answers

Check status of process

Hi All, Have a query How to check for a process and if down start it , try if for 2 times and its not starting don't do it My code is working to some extent but while starting try starting both times. Please advise , whats wrong here ? if you have any other approach please do share. My... (1 Reply)
Discussion started by: abhaydas
1 Replies
SOCKSTAT(1)						    BSD General Commands Manual 					       SOCKSTAT(1)

NAME
sockstat -- list open sockets SYNOPSIS
sockstat [-46cLlu] [-j jid] [-p ports] [-P protocols] DESCRIPTION
The sockstat command lists open Internet or UNIX domain sockets. The following options are available: -4 Show AF_INET (IPv4) sockets. -6 Show AF_INET6 (IPv6) sockets. -c Show connected sockets. -j jid Show only sockets belonging to the specified jail ID. -L Only show Internet sockets if the local or foreign addresses are not in the loopback network prefix 127.0.0.0/8, or do not con- tain the IPv6 loopback address ::1. -l Show listening sockets. -p ports Only show Internet sockets if either the local or foreign port number is on the specified list. The ports argument is a comma- separated list of port numbers and ranges specified as first and last port separated by a dash. -P protocols Only show sockets of the specified protocols. The protocols argument is a comma-separated list of protocol names, as they are defined in protocols(5). -u Show AF_LOCAL (UNIX) sockets. If neither -4, -6 or -u is specified, sockstat will list sockets in all three domains. If neither -c or -l is specified, sockstat will list both listening and connected sockets. The information listed for each socket is: USER The user who owns the socket. COMMAND The command which holds the socket. PID The process ID of the command which holds the socket. FD The file descriptor number of the socket. PROTO The transport protocol associated with the socket for Internet sockets, or the type of socket (stream or datagram) for UNIX sockets. LOCAL ADDRESS For Internet sockets, this is the address the local end of the socket is bound to (see getsockname(2)). For bound UNIX sockets, it is the socket's filename. For other UNIX sockets, it is a right arrow followed by the endpoint's filename, or ``??'' if the endpoint could not be determined. FOREIGN ADDRESS (Internet sockets only) The address the foreign end of the socket is bound to (see getpeername(2)). If a socket is associated with more than one file descriptor, it is shown multiple times. If a socket is not associated with any file descriptor, the first four columns have no meaning. SEE ALSO
fstat(1), netstat(1), procstat(1), inet(4), inet6(4), protocols(5) HISTORY
The sockstat command appeared in FreeBSD 3.1. AUTHORS
The sockstat command and this manual page were written by Dag-Erling Smorgrav <des@FreeBSD.org>. BSD
May 16, 2012 BSD
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy