lsof

lsof survival guide

lsof is an increadibly powerful command-line utility for unix systems. It lists open files, displaying information about them. And since most everything is a file on unix systems, lsof can give sysadmins a ton of useful diagnostic data. What are some of the most common and useful ways of using lsof, and which command-line switches are u...

How to close a file descriptor from another process in unix systems

You can use command lsof to get file descriptors for all running processes, but what I would like to do is to close some of those descriptors without being inside that process. This can be done on Windows, so you can easily unblock some application. Is there any command or function for that? ...

How to find the other point of a Unix domain socket on Mac OS X to write/read it?

Hello everyone, I listed open file for a process (a daemon) on my box which runs Mac OS X 10.5 : >lsof -p 89 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME ... xxxxx 89 xxxxxxxx 9u unix 0x34f8990 0t0 ->0x34f8880 I 'd like to find a way to open this socket and write in it. (that's my obsession...

LSOF connection established

I was wondering, if the output of lsof -i sshd 21880 root 3r IPv4 4843515 TCP somehost.lu.isp.com:ssh->d-XX-XXX.ITS.SOMEWHERE.COM:45037 (ESTABLISHED) sshd 21882 mike 3u IPv4 4843515 TCP somehost.lu.isp.com:ssh->d-XX-XXX.ITS.SOMEWHERE.COM:45037 (ESTABLISHED) sshd 23853 root 3u IPv6 9...

Link to a specific inode

I have a file that was deleted, but is still held open my a program. I found the inode number using lsof. How can I create a hard link back to that inode? Any code helps, but Perl would be handy. ...

Verify whether ftp is complete or not?

Hello, I got an application which is polling on a folder continuously. Once any file is ftp to the folder, the application has to move this file to some other folder for processing. Here, we don't have any option to verify whether ftp is complete or not. One command "lsof" is suggested in the technical forums. It got a file descriptio...

How to debug a connection failure between Jboss and eclipse debugger.

I have setup eclipse to attach to a local JVM. But when I try to do the same for a machine over the network I get "connection timed out exception". How do I go about debugging this issue? I tried: lsof -i :8787 on the remote machine, and it appears that a java process is in fact listening on that port. What else could be wrong and h...

Is it possible to control which libraries apache uses?

Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library. I can't really do that on my machine, however, as it's RHEL and so many things are dependent on libjpeg and libjpeg-devel (when I tried yum remove libjpeg just to see, there were a total of ...

What's the fastest way using lsof to find a single open file?

I'm trying to test a single file if it is open using lsof. Is there a faster way than this? $result = exec('lsof | grep filename | wc -l'); if($result > 0) { //file is open } I'm thinking their must be a way to just test for one file if you know the filename. All I really need is a true or false. ...