Open main menu

Changes

1,375 bytes added ,  01:07, 28 July 2016
Created page with "LSOF - the utility with the most options ever == What application is spying on you today? == <code>lsof -i</code> will show you the open internet connections to your server...."
LSOF - the utility with the most options ever

== What application is spying on you today? ==
<code>lsof -i</code> will show you the open internet connections to your server. You may discover some strange (outbound) connections that you didn't know about and don't recognize.
http://www.tcpiputils.com/ is an interesting service that provides quick access to some network tools to help you determine what/who those parties are.

== How do you see a process change over time ==
You could normally use <code>watch --differences --interval 1</code> to show things change. But my QNAP NAS doesn't have the watch command. The lsof command has an interval capability with the +-r option

== MySQL is running, but non-standard ==
Use <code>lsof -i -a -c mysql</code> for Internet and command mysql

== Problems with NFS ==
Use <code>lsof -N</code> which selects the listing of NFS files

== Is Sendmail or something running for mail? ==
Use <code>lsof -i :25</code> which shows everything running on port 25

== Oh My GAWD, I deleted my Apache log ==
It's possible, if the deleted file is still being held open by a daemon or process, to save the contents of the deleted file. You can find out by using lsof. See the IBM article below.

== More reading ==
* https://www.ibm.com/developerworks/aix/library/au-lsof.html
* http://www.thegeekstuff.com/2012/08/lsof-command-examples
4,558

edits