coolcommands.com - the search engine for unix sysadmins :: unix commands and scripts
Sunday May 27, 2012


 Home
 Search
 Advanced Search
 Category Search
 Affiliates
 Acknowledgements
 Cool Links

Username

Password

Remember me
Forgot your password?
Create an account

Who's Online
We have 20 guests online

Newest Member

beyondimagem

Hit Counter
9133554 Visitors

cool Statistics
coolcommands:1330
Categories:83
Total queries:595500
Members:16437





Category Search coolcommands.com
Select Category:


coolcommand

lsof - how to list open files
Description

To list all open files:

# lsof

To list all open files on a device:

# lsof /dev/hd4

To see which tcp ports are listening on a server for a specific process id:

# lsof -p pid | grep -i tcp

To see listing of files open for a specific ip or port:

# lsof -i :[hostname|ip address][:service|port]

Exemple to find who is listening on port 18011:

# netstat -an | grep 18011 | grep LIST
tcp4 0 0 172.26.25.167.18011 207.96.246.57.53445 ESTABLISHED
tcp4 0 0 *.18011 *.* LISTEN

# lsof -i:18011
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
swora81 144574 root 6u IPv4 0x71910adc 0t0 TCP *:SL_18011 (LISTEN)
swora81 144574 root 11u IPv4 0x72022adc 0t0 TCP server1:SL_18011->server2:53445
(ESTABLISHED)
oracle 711808 daemon 11u IPv4 0x72022adc 0t0 TCP server1:SL_18011->server2:53445
(ESTABLISHED)
oracle 711808 daemon 21u IPv4 0x7244dadc 0t0 TCP server1:SL_18011->server2:53409
(CLOSE_WAIT)
Example

lsof -p 12000 | grep -i tcp

Return to search results

Random coolcommands

coolcommand: oslevel - to find level of IBM AIX
Example: oslevel
[show me the details]
coolcommand: how to determine of your file name has a space at the end
Example: ls | od -b
[show me the details]
coolcommand: how to identify which package a file belongs to in Sun Solaris
Example: /usr/sbin/pkgchk -l -p /usr/bin/ls
[show me the details]
coolcommand: csplit or split - split a large file into smaller ones
Example: csplit file keyword
[show me the details]

coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts



FREE
myPMS

Password
Management
System

by

LVOware.com




Top 5 Submitters

lvo1152
audet37
kah00na32
Mariom24
lebjf00014

Top 5 Searches

Category Solaris49379
Category AIX46267
Category General UNIX43933
solaris22927
aix22116

Terms of Use
Privacy
Contact


 
coolcommands.com © 2012. All Right Reserved.
Programming by PRATTICO Consulting . Hosting by Apricusum