hostname(1): Add EXAMPLES to man page

Add a very simple set of examples

Approved by:	manpages (bcr@)
Differential Revision:	https://reviews.freebsd.org/D26663
This commit is contained in:
Fernando Apesteguía 2020-10-05 13:46:19 +00:00
parent ad3d2e7e4a
commit 5145778475

View File

@ -29,7 +29,7 @@
.\" @(#)hostname.1 8.2 (Berkeley) 4/28/95 .\" @(#)hostname.1 8.2 (Berkeley) 4/28/95
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd November 10, 2016 .Dd October 5, 2020
.Dt HOSTNAME 1 .Dt HOSTNAME 1
.Os .Os
.Sh NAME .Sh NAME
@ -66,6 +66,25 @@ name.
.It Fl d .It Fl d
Only print domain information. Only print domain information.
.El .El
.Sh EXAMPLES
Set the host name of the machine and check the result:
.Bd -literal -offset indent
$ hostname beastie.localdomain.org
$ hostname
beastie.localdomain.org
.Ed
.Pp
Do not show domain information:
.Bd -literal -offset indent
$ hostname -s
beastie
.Ed
.Pp
Show only domain information:
.Bd -literal -offset indent
$ hostname -d
localdomain.org
.Ed
.Sh SEE ALSO .Sh SEE ALSO
.Xr gethostname 3 , .Xr gethostname 3 ,
.Xr rc.conf 5 .Xr rc.conf 5