aboutsummaryrefslogtreecommitdiffhomepage
path: root/print.html
diff options
context:
space:
mode:
authorjohannst <johannst@users.noreply.github.com>2020-10-02 09:28:40 +0000
committerjohannst <johannst@users.noreply.github.com>2020-10-02 09:28:40 +0000
commitbeb173a31622e99e40301d95bc74c0e63be7bea9 (patch)
tree28f07a6f736541d777602f2d3f78009536a3b6c5 /print.html
parent437b37306ec441823d401fe64fbf99936754b206 (diff)
downloadnotes-beb173a31622e99e40301d95bc74c0e63be7bea9.tar.gz
notes-beb173a31622e99e40301d95bc74c0e63be7bea9.zip
deploy: d0f74b8605d72868c49fec7d27225398118f9409
Diffstat (limited to 'print.html')
-rw-r--r--print.html18
1 files changed, 17 insertions, 1 deletions
diff --git a/print.html b/print.html
index 1b1bc35..7179ad2 100644
--- a/print.html
+++ b/print.html
@@ -1147,12 +1147,15 @@ executed. To workaround that bug one can create a wrapper function which calls
</ul>
<h1><a class="header" href="#lsof8" id="lsof8">lsof(8)</a></h1>
<pre><code class="language-markdown">lsof
+ -r &lt;s&gt; ..... repeatedly execute command ervery &lt;s&gt; seconds
-a ......... AND slection filters instead ORing (OR: default)
-p &lt;pid&gt; ... filter by &lt;pid&gt;
+fg ........ show file flags for file descripros
-n ......... don't convert network addr to hostnames
-P ......... don't convert network port to service names
-i &lt;@h[:p]&gt;. show connections to h (hostname|ip addr) with optional port p
+ -s &lt;p:s&gt; ... in conjunction with '-i' filter for protocol &lt;p&gt; in state &lt;s&gt;
+ -U ......... show unix domain sockets ('@' indicates abstract sock name, see unix(7))
</code></pre>
<pre><code class="language-markdown">file flags:
R/W/RW ..... read/write/read-write
@@ -1160,6 +1163,16 @@ executed. To workaround that bug one can create a wrapper function which calls
AP ......... append
TR ......... truncate
</code></pre>
+<pre><code class="language-markdown">-s protocols
+ TCP, UDP
+
+-s states (TCP)
+ CLOSED, IDLE, BOUND, LISTEN, ESTABLISHED, SYN_SENT, SYN_RCDV, ESTABLISHED,
+ CLOSE_WAIT, FIN_WAIT1, CLOSING, LAST_ACK, FIN_WAIT_2, TIME_WAIT
+
+-s states (UDP)
+ Unbound, Idle
+</code></pre>
<h1><a class="header" href="#examples-2" id="examples-2">Examples</a></h1>
<h2><a class="header" href="#file-flags" id="file-flags">File flags</a></h2>
<p>Show open files with file flags for process:</p>
@@ -1167,7 +1180,7 @@ executed. To workaround that bug one can create a wrapper function which calls
</code></pre>
<h2><a class="header" href="#open-tcp-connections" id="open-tcp-connections">Open TCP connections</a></h2>
<p>Show open tcp connections for <code>$USER</code>:</p>
-<pre><code class="language-markdown">lsof -a -u $USER -i tcp
+<pre><code class="language-markdown">lsof -a -u $USER -i TCP
</code></pre>
<p><strong>Note</strong>: <code>-a</code> <em>ands</em> the results. If <code>-a</code> is not given all open files matching
<code>$USER</code> and all tcp connections are listed (<em>ored</em>).</p>
@@ -1175,6 +1188,9 @@ executed. To workaround that bug one can create a wrapper function which calls
<p>Show open connections to <code>localhost</code> for <code>$USER</code>:</p>
<pre><code class="language-markdown">lsof -a -u $USER -i @localhost
</code></pre>
+<h2><a class="header" href="#ipv4-tcp-connections-in-established-state" id="ipv4-tcp-connections-in-established-state">IPv4 TCP connections in <code>ESTABLISHED</code> state</a></h2>
+<pre><code class="language-markdown">lsof -i 4TCP -s TCP:ESTABLISHED
+</code></pre>
<h1><a class="header" href="#pidstat1" id="pidstat1">pidstat(1)</a></h1>
<pre><code class="language-markdown">pidstat [opt] [interval] [cont]
-U [user] show username instead UID, optionally only show for user