You can get a list of all open files by using lsof command. Depending on your local configurations, you may need root privileges to run it.
lsof is much more useful if used together with grep. For example, if you want to see if someone is opening your secret file, you can do
% lsof | grep 'secret_file'
Furthermore, since in unix "everything is a file," you can even do:
% lsof | grep /dev/dsp
to see what process is locking your sound device.
Also, the list of all open network sockets (TCP,UDP and unix domain) along
with the process that has the socket open can be got using the netstat
command:
This is very usefull! I come to know today that 'esd' was blocking my sound
device and didn't let me play the music without root privilege!
this info is great but once I find an open file does anyone know how to
unlock the file. I'v got users that are trying to open and file but it will
only let them open the file in read only mode. any ideas