From 2a064a9d1bbb8de6ce489b685cce026eee167cd2 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 17 Mar 2020 22:48:49 +0000 Subject: deploy: fb719f52b73920fb18c7f3080ebb1fc73300be49 --- lsof.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lsof.html') diff --git a/lsof.html b/lsof.html index 63d37e9..2e4d9f0 100644 --- a/lsof.html +++ b/lsof.html @@ -81,7 +81,7 @@ @@ -151,10 +151,10 @@

lsof(8)

lsof
   -a ......... AND slection filters instead ORing (OR: default)
-  -p <pid> ... list open file descriptors for process
+  -p <pid> ... filter by <pid>
   +fg ........ show file flags for file descripros
   -n ......... don't convert network addr to hostnames
-  -P ......... don't convert network port to know service names
+  -P ......... don't convert network port to service names
   -i <@h[:p]>. show connections to h (hostname|ip addr) with optional port p
 
file flags:
@@ -164,13 +164,18 @@
   TR ......... truncate
 

Examples

-

Show open files with file flags:

+

File flags

+

Show open files with file flags for process:

lsof +fg -p <pid>
 
-

Show open tcp connections from user:

+

Open TCP connections

+

Show open tcp connections for $USER:

lsof -a -u $USER -i tcp
 
-

Show open connections to 'localhost' for user:

+

Note: -a ands the results. If -a is not given all open files matching +$USER and all tcp connections are listed (ored).

+

Open connection to specific host

+

Show open connections to localhost for $USER:

lsof -a -u $USER -i @localhost
 
-- cgit v1.2.3