How to list all outbound sockets given a PID?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to list all outbound sockets given a PID?
# 1  
Old 07-17-2018
Hammer & Screwdriver How to list all outbound sockets given a PID?

I used netstat -tp <pid> to list all Foreign Addresses i.e OutBound sockets on Linux.

Likewise, i wish to list all Foreign Addresses on Sparc Solaris.

I get illegal option -- t when i try this command on Solaris.

The second query i have is that in the output of netstat command some foreign address shows string instead of numeric port number as shown in bold & red below output. Can you please tell me what & why is that so ?
Quote:
Foreign Address
10.122.212.210:ldap
10.122.212.210:ncube-1m
10.122.212.210:ingreslock

Last edited by mohtashims; 07-17-2018 at 10:11 AM..
# 2  
Old 07-17-2018
After consulting
Code:
man netstat

I have found that
Code:
netstat -n -f inet -f inet6

in Solaris comes close to the Linux
Code:
netstat -n -t

Solaris does not have anything that corresponds to the -p (show associated pids) in Linux.
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to track Inbound Outbound connections to PID?

I have a Application Server process that hosts my application web & EJB and JMS and Database connectios etc. Using the PID what is the best way to find out the Inbound connection sockets i.e those parties that connect to my server process on different ports numbers and Outbound connection... (2 Replies)
Discussion started by: mohtashims
2 Replies

2. Shell Programming and Scripting

Unix Script -- Suggestions to list and kill PID's sequentially

Hi, I'm trying to write a script where i'm trying to grep the PID and the associated file and list them. Then execute the KILL command sequentially on the listed PID's for ".tra" files ==================================================== ps -aux | grep mine adm 27739 0.2 0.8 1131588... (12 Replies)
Discussion started by: murali1687
12 Replies

3. Shell Programming and Scripting

list of all predecessors and successors for given PID

Dear experts, I'm moving from SunOS to Linux. Linux has no ptree, but it has pstree. Anyway, pstree doesn't show what ptree used to print with output nice to grep. My Linux distribution doesn't have proctree either. This forum has few posts touching ptree/pstree topic, but I didn't... (2 Replies)
Discussion started by: bzk
2 Replies

4. Programming

Print ancestor list in c (name and PID)

I am trying to write a C program that prints its ancestor name and PID For example: Lets say my program name is prog1 then the output should be prog1 with PID: 2345 bash with PID: 4567 .... init with PID: 1 This is just a scratch work. #include <stdio.h> #include <unistd.h> #include... (5 Replies)
Discussion started by: nimesh
5 Replies

5. UNIX for Dummies Questions & Answers

Outbound file will be routed to new server

Hi, ---------- Post updated at 04:12 AM ---------- Previous update was at 04:09 AM ---------- This is the scripts.. Date=`date +"%m/%d/%y %H:%M:%S "` echo "Run on $Date" echo "Run on $Date" >&2 # Setting Variables PassDir=$PS_HOME/autosys/pass # Location of the... (0 Replies)
Discussion started by: sonja
0 Replies

6. Linux

Outbound IP Address selection

I have a server with multiple Internet IP Addresses: x.x.x.1 x.x.x.2 x.x.x.3 x.x.x.4 . . . When I use links to goto a website it uses the lowest x.x.x.1 Is there a way when I invoke links, or ftp or what ever, to use x.x.x.2 or x.x.x.99 when i start the application? (2 Replies)
Discussion started by: Ikon
2 Replies

7. 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

8. 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

9. Red Hat

How to check the outbound packets in Linux

I have a linux redhat box , our security department in my company informed me that my server's IP sends So many traffic in my network , This box I am using it as FTP server to store the other servers logs . My question briefly is how to check my outbound packets which are going from my PC to the... (1 Reply)
Discussion started by: DarkSoul
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