Linux Box Admin
Trusted Remote Administration
logo

Tilde
What's new
Articles
Micro HowTos
About
Contact







Index arrow Micro HowTos

index of all micro how-tos
arrow Userland

List Open Files with lsof
(0 votes)
Wednesday, 07 March 2007
   
    List Open Files (lsof)    
     
       
 

The lsof program is a great tool to find open files. One case you might need this is to find a process that has an open file on a device you are trying to unmount.

List your own open files (includes sockets and pipes):

lsof

List all open files on the system (includes sockets and pipes), as root:

lsof

List open files for certain processes, as root:

lsof -c pattern
where pattern is the first few letters of the process name or a regular expression between forward slashes /regexp/.

List all open network sockets, as root:

lsof -i
Useful to make sure something unexpected isn't listening to the network.
   
       
         
 



Copyright © 2006,2007 Linux Box Admin.

 
My NHL fan blog