Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Dec 2020 18:34:16 +0000 (UTC)
From:      =?UTF-8?Q?Fernando_Apestegu=c3=ada?= <fernape@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368520 - head/usr.bin/id
Message-ID:  <202012101834.0BAIYGut028441@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fernape (ports committer)
Date: Thu Dec 10 18:34:15 2020
New Revision: 368520
URL: https://svnweb.freebsd.org/changeset/base/368520

Log:
  id(1): Add EXAMPLES section
  
  Add some examples covering the flags: G, n, P, p, u
  
  Add reference to groups(1)
  
  Approved by:	manpages (gbe@)
  Differential Revision:		https://reviews.freebsd.org/D27539

Modified:
  head/usr.bin/id/id.1

Modified: head/usr.bin/id/id.1
==============================================================================
--- head/usr.bin/id/id.1	Thu Dec 10 18:07:25 2020	(r368519)
+++ head/usr.bin/id/id.1	Thu Dec 10 18:34:15 2020	(r368520)
@@ -136,7 +136,43 @@ Display the effective user ID as a number.
 .El
 .Sh EXIT STATUS
 .Ex -std
+.Sh EXAMPLES
+Show information for the user
+.Ql bob
+as a password file entry:
+.Bd -literal -offset indent
+$ id -P bob
+bob:*:0:0::0:0:Robert:/bob:/usr/local/bin/bash
+.Ed
+.Pp
+Same output as
+.Xr groups 1 for the root user:
+.Bd -literal -offset indent
+$ id -Gn root
+wheel operator
+.Ed
+.Pp
+Show human readable information about
+.Ql alice :
+.Bd -literal -offset indent
+$ id -p alice
+uid     alice
+groups  alice webcamd vboxusers
+.Ed
+.Pp
+Assuming the user
+.Ql bob
+executed
+.Dq Nm su Fl l
+to simulate a root login, compare the result of the following commands:
+.Bd -literal -offset indent
+# id -un
+root
+# who am i
+bob          pts/5        Dec  4 19:51
+.Ed
 .Sh SEE ALSO
+.Xr groups 1 ,
 .Xr who 1
 .Sh STANDARDS
 The



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012101834.0BAIYGut028441>