hi,
NB. List open files (remember in unix everything is a file)
Here is some simple uses:
To see all open files of a paricular process (via its pid):
# lsof -p
To see all open files associated with a command:
# lsof -c cron
...or by a logon name:
# lsof -u
# lsof -u
...or what process is using a TCP socket:
# lsof -i tcp:161
# lsof -i udp:161
Also
a. suppose a process has a port which is hanging,
you can grep on the port no.,
know which process owned that port no.,
kill that process to free that port. Generally helpful in web applications.
b. when you want to find out whos creating the /tmp/log that is building rappidly,
c. when you want to unmount a filesystem but it's busy, find out who's using it.
hope this helps!
regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)