Sunday, September 16, 2012

lsof replacement for windows

I must admit, i sorely miss lsof. This is sorely aggravated by the moronic way in which locks prevent you from working under windows. You can't delete or move folders with open file handles under them or files that are opened. This is not a problem most of the time, but when texing this can be a pain. Finding out what to close in order to be able to rename a folder can be challenging.
While i would love a
lsof <file>
under linux, this isn't an option. There are replacements like process hacker but I just found out about
openfiles /query <file>
Since this saves me from installing yet another tool, this is cool. :) You probably will have to enable the list keeping first, it's off by default. So in a root shell enter
/openfiles /local on 
and reboot (yes reboot, no kidding).

For the network aspect
lsof -i 
showing you opened connections and sockets, use
netstat /B
(maybe some other switch as well, there are plenty)

No comments:

Post a Comment