From owner-svn-src-head@freebsd.org Sat Jun 13 17:36:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FB7333E2D3; Sat, 13 Jun 2020 17:36:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49klBK2byPz4Jn5; Sat, 13 Jun 2020 17:36:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5491A1EAB2; Sat, 13 Jun 2020 17:36:09 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05DHa9h0025456; Sat, 13 Jun 2020 17:36:09 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05DHa9fY025455; Sat, 13 Jun 2020 17:36:09 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202006131736.05DHa9fY025455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Sat, 13 Jun 2020 17:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362149 - head/usr.bin/sockstat X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/usr.bin/sockstat X-SVN-Commit-Revision: 362149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Jun 2020 17:36:09 -0000 Author: fernape (ports committer) Date: Sat Jun 13 17:36:08 2020 New Revision: 362149 URL: https://svnweb.freebsd.org/changeset/base/362149 Log: sockstat(1): Add EXAMPLES to man page Add three examples showing the use of -4, -6, -l, -L, -p and -P Reviewed by: gbe@ Approved by: bcr@ Modified: head/usr.bin/sockstat/sockstat.1 Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Sat Jun 13 14:11:02 2020 (r362148) +++ head/usr.bin/sockstat/sockstat.1 Sat Jun 13 17:36:08 2020 (r362149) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2018 +.Dd June 13, 2020 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -177,6 +177,23 @@ If a socket is associated with more than one file desc it is shown multiple times. If a socket is not associated with any file descriptor, the first four columns have no meaning. +.Sh EXAMPLES +Show information for IPv4 sockets listening on port 22 using protocol +TCP: +.Bd -literal -offset indent +$ sockstat -4 -l -P tcp -p 22 +.Ed +.Pp +Show information for sockets using either TCP or UDP, if neither, the local nor +the foreign addresses are in the loopback network: +.Bd -literal -offset indent +$ sockstat -L -P tcp,udp +.Ed +.Pp +Show TCP IPv6 sockets which are listening and connected (default): +.Bd -literal -offset indent +$ sockstat -6 -P tcp +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr netstat 1 ,