- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- lsof question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 07:51 AM
06-05-2007 07:51 AM
I need to check for files which are being used by a particular port. How do I do that through lsof.
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 07:56 AM
06-05-2007 07:56 AM
Solution-i [i] This option selects the listing of files any of whose Internet
address matches the address specified in i. If no address is
specified, this option selects the listing of all Internet and
x.25 (HP-UX) network files.
If -i4 or -i6 is specified with no following address, only
files of the indicated IP version, IPv4 or IPv6, are dis-
played. (An IPv6 specification may be used only if the
dialects supports IPv6, as indicated by ``[46]'' and
``IPv[46]'' in lsof's -h or -? output.) Sequentially speci-
fying -i4, followed by -i6 is the same as specifying -i, and
vice-versa. Specifying -i4, or -i6 after -i is the same as
specifying -i4 or -i6 by itself.
Multiple addresses (up to a limit of 100) may be specified
with multiple -i options. (A port number or service name
range is counted as one address.) They are joined in a single
ORed set before participating in AND option selection.
An Internet address is specified in the form (Items in square
brackets are optional.):
[46][protocol][@hostname|hostaddr][:service|port]
where:
46 specifies the IP version, IPv4 or IPv6
that applies to the following address.
'6' may be be specified only if the UNIX
dialect supports IPv6. If neither '4' nor
'6' is specified, the following address
applies to all IP versions.
protocol is a protocol name - TCP or UDP.
hostname is an Internet host name. Unless a
specific IP version is specified, open
network files associated with host names
of all versions will be selected.
hostaddr is a numeric Internet IPv4 address in
dot form; or an IPv6 numeric address in
colon form, enclosed in brackets, if the
UNIX dialect supports IPv6. When an IP
version is selected, only its numeric
addresses may be specified.
service is an /etc/services name - e.g., smtp -
or a list of them.
port is a port number, or a list of them.
Can you try something like 'lsof -i :49152' or 'lsof -i @
The grep for the filename.
Jov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 08:01 AM
06-05-2007 08:01 AM
Re: lsof question
For example to find all the processes associated with port 23 (telnet), you can specify either the port number or name
lsof -i :23
or
lsof -i :telnet
then when the process id is displayed:
lsof -p PID
and you have your files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 08:03 AM
06-05-2007 08:03 AM
Re: lsof question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 08:18 AM
06-05-2007 08:18 AM
Re: lsof question
Jov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 09:02 AM
06-05-2007 09:02 AM
Re: lsof question
The output I got from lsof is similar to netstat -an
java 5987 prod 75u inet 0x300160a96c0 0t0 TCP *:10222 (LISTEN)
The Java developers say that the port 10222 is not freed up and is in listening mode , though I was of the view that the port is free and is listening .
The argument they gave me was that CORBA ORB is initialized and passes this port to a request from another server and the connection is made and once the connection is released then the port is not in listening mode and should not come up in the listing of netstat or the lsof as its coming up now.( above output )
Has anybody encountered this before. Any suggestions are welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2007 09:12 AM
06-05-2007 09:12 AM
Re: lsof question
More clear explanation from Java Devs :
The port should be in listening mode once the ORB has been reinitialized not before that.
Anybody faced this with CORBA ORB or any other application.