Finding Who Has A File Open
Filed in archive by Michael Hammer on August 25, 2006
can you not eject a CD because something's got it open? How many times have you experienced a "file browser" that keeps a directory open even after you've navigated out of that directory and clicked the "refresh" button? Who's got this thing open??? Use thefuserprogram to find out: [slitt@mydesk slitt]$ /sbin/fuser -mu /d/d: 1693(slitt) 1891c(slitt) 1894 1894c(slitt) 1907 1907c(slitt) 1908 1908c(slitt) 1909 1909c(slitt) 1910 1910c(slitt) 1912 1912c(slitt) 1913 1913c(slitt)[slitt@mydesk slitt]$
You get the owner and the process ID. From there you can research usingps ax.
Be sure to look at the fuser man page for details on other info you can obtain. You can even kill all processes accessing a file, though I highly recommend against such a heavy handed move.
Permalink: Finding Who Has A File Open
Tags:
linux code server source failure open finding+file file+open
Trackback: http://www.creative-weblogging.com/cgi-bin/mt-tb.pl/34402










