|
| cool Statistics |
| | coolcommands: | 1338 | | Categories: | 83 | | Total queries: | 621841 | | Members: | 22813 | |
|
|
|
 |
|
|
Search coolcommands.com
 |
Submitted by:
lvo   |
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: top - how to display and update information about the top cpu processes
Example: top
[show me the details] |
coolcommand: how to get login name, suid, database and password in Sybase
Example: select name,suid,dbname,password from syslogins
[show me the details] |
coolcommand: how to monitor routing table lookup misses and changes in Sun Solaris
Example: route monitor
[show me the details] |
coolcommand: how to mount a cdrom manually in Sun Solaris
Example: mount -o ro /dev/dsk/c0t6d0s1 /mnt/cdrom
[show me the details] |
|
|
coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts
|  |  |  |  |
|
|
|
|
 |
|
|
|
Top 5 Submitters
|
|---|
| lvo | 1160 |
| audet | 37 |
| kah00na | 32 |
| Mariom | 24 |
| lebjf000 | 14 |
Top 5 Searches
|
| Category Solaris | 52059 |
| Category AIX | 49318 |
| Category General UNIX | 47865 |
| solaris | 23555 |
| aix | 22814 |
|
|
|
|