mirror of
https://github.com/cheat/cheat.git
synced 2024-12-18 18:55:06 +01:00
Enhancements to 'lsof' cheatsheet.
This commit is contained in:
parent
d8c723681a
commit
94a147ba77
@ -1,8 +1,23 @@
|
|||||||
# List all ipv4 network files
|
# List all IPv4 network files
|
||||||
sudo lsof -i4
|
sudo lsof -i4
|
||||||
|
|
||||||
|
# List all IPv6 network files
|
||||||
|
sudo lsof -i6
|
||||||
|
|
||||||
# To find listening ports:
|
# To find listening ports:
|
||||||
lsof -Pnl +M -i4
|
lsof -Pnl +M -i4
|
||||||
|
|
||||||
# To find which program is using the port 80:
|
# To find which program is using the port 80:
|
||||||
lsof -i TCP:80
|
lsof -i TCP:80
|
||||||
|
|
||||||
|
# List all processes accessing a particular file/directory
|
||||||
|
lsof </path/to/file>
|
||||||
|
|
||||||
|
# List all files open for a particular user
|
||||||
|
lsof -u <username>
|
||||||
|
|
||||||
|
# List all files/network connections a given process is using
|
||||||
|
lsof -c <command-name>
|
||||||
|
|
||||||
|
# See this primer: http://www.danielmiessler.com/study/lsof/
|
||||||
|
# for a number of other useful lsof tips
|
||||||
|
Loading…
Reference in New Issue
Block a user