Differences

This shows you the differences between two versions of the page.

Link to this comparison view

lsof [2014/05/09 12:07] (current)
Line 1: Line 1:
 +====== lsof ======
  
 +** Show networking on a port **
 +
 +<​code>​
 +lsof -iTCP -i :port
 +lsof -i :22
 +</​code>​
 +
 +** Show connections to a host **
 +
 +<​code>​
 +lsof -i@192.16­8.1.5
 +</​code>​
 +
 +** Find ports that are being listened to **
 +
 +<​code>​
 +lsof -i | grep LISTEN
 +</​code>​
 +
 +** Find files open by user **
 +
 +<​code>​
 +lsof -u <​us­er>​
 +</​code>​
 +
 +** Find files open by command **
 +
 +<​code>​
 +lsof -c <​co­mma­nd>​
 +</​code>​
 +
 +** Find files open by proccess id **
 +
 +<​code>​
 +lsof -p <​pi­d>​
 +</​code>​