07-17-2018
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..
10 More Discussions You Might Find Interesting
1. Programming
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
2. Red Hat
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
3. UNIX for Dummies Questions & Answers
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
4. UNIX for Dummies Questions & Answers
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
5. Linux
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
6. UNIX for Dummies Questions & Answers
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
7. Programming
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
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
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
LEARN ABOUT NETBSD
sockstat
SOCKSTAT(1) BSD General Commands Manual SOCKSTAT(1)
NAME
sockstat -- list open sockets
SYNOPSIS
sockstat [-46clnu] [-f address_family] [-p ports]
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.
-f address_family
Limit listed sockets to those of the specified address_family. The following address families are recognized: inet, for AF_INET;
inet6, for AF_INET6; and local or unix, for AF_LOCAL.
-l Show listening sockets.
-n Numeric output only. No attempt will be made to look up symbolic names for addresses and ports.
-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.
-u Show AF_LOCAL (UNIX) sockets.
If neither -4, -6, nor -u are specified, sockstat will list sockets in all three domains.
If neither -c nor -l are specified, sockstat will list both listening and connected sockets, as well as those sockets that are in neither
state.
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, seqpacket or data-
gram) for UNIX sockets.
LOCAL ADDRESS For Internet sockets, this is the address to which the local end of the socket is bound (see getsockname(2)). For bound
UNIX sockets, it is the socket's filename or ``-''.
FOREIGN ADDRESS The address to which the foreign end of the socket is bound (see getpeername(2)) or ``-'' for unconnected UNIX sockets.
SEE ALSO
fstat(1), netstat(1), inet(4), inet6(4), unix(4)
HISTORY
The sockstat command appeared in FreeBSD 3.1. It was then rewritten for NetBSD 3.0.
AUTHORS
This version of the sockstat command was written by Andrew Brown <atatat@NetBSD.org>. This manual page was written by Dag-Erling Smorgrav
<des@FreeBSD.org> and was adapted to match the NetBSD implementation by Andrew Brown <atatat@NetBSD.org>.
BSD
July 14, 2006 BSD