Tugger the SLUGger!SLUG Mailing List Archives

RE: [SLUG] Finding open files on the system


man lsof

-Greg

On 09-May-01 Andrew Eager wrote:
> At the last meeting,  it was asked:
> 
> " If the disk is spinning madly is there any way to determine which 
> process is causing the activity ?"
> 
> A bloody good question that I have asked myself many times.  I used to 
> have a utility called 'fopen' under QNX but not under linux.
> 
> If anyone is interested,  I have written a utility called 'fopen' which 
> does the following
> 
>   a)  Prints the PID, Process name & Currently open files for that PID
>   b)  as above but for sockets
>   c)  as above but for pipes.
> 
> It also prints either the size of the file (so you can see it growing) 
> or optionally, the time since last access/change/modification.
> 
> Example:
> 
>    PID    PROCESS            TIME         FILE/RESOURCE
>   1161   crond                    00:05:18      /var/log/cron
> 
>     ..... etc
> 
> If anyone interested, let me know.
> 
> Andrew E.
> 
> 
> 
> -- 
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://lists.slug.org.au/listinfo/slug

+---------------------------------------------------------------------+
"DOS Computers manufactured by companies such as IBM, Compaq, Tandy, and
millions of others are by far the most popular, with about 70 million
machines in use wordwide. Macintosh fans, on the other hand, may note that
cockroaches are far more numerous than humans, and that numbers alone do
not denote a higher life form."       (New York Times, November 26, 1991)
| Greg Hosler                           i-net:  hosler@xxxxxxxxxxx    |
+---------------------------------------------------------------------+