Differences
This shows you the differences between two versions of the page.
lsof [2014/05/09 12:07] |
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 [email protected]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 <user> | ||
+ | </code> | ||
+ | |||
+ | ** Find files open by command ** | ||
+ | |||
+ | <code> | ||
+ | lsof -c <command> | ||
+ | </code> | ||
+ | |||
+ | ** Find files open by proccess id ** | ||
+ | |||
+ | <code> | ||
+ | lsof -p <pid> | ||
+ | </code> |