100 Useful Command-Line Utilities

by Oliver; 2014

102. lsof

lsof shows all open files on your computer and tells you which user and process ID is opening the particular file. This is surprisingly useful for debugging, among other things. Want to see what files myprogram is opening or writing to? Is it, say, writing to the /tmp directory? Try:
$ lsof | grep myprogram
To show your network connections, use:
$ lsof -i
Read more:

<PREV   NEXT>