Index: contrib/vis/vis.1 =================================================================== --- contrib/vis/vis.1 +++ contrib/vis/vis.1 @@ -155,6 +155,25 @@ Specify the locale of the input data. Set to C if the input data locale is unknown. .El +.Sh EXAMPLES +Visualize characters encoding white spaces and tabs: +.Bd -literal -offset indent +$ echo -e "\\x10\\n\\t" | vis -w -t +\\^P\\012\\011\\012 +.Ed +.Pp +Same as above but using `\\$' for newline followed by an actual newline: +.Bd -literal -offset indent +$ echo -e "\\x10\\n\\t" | vis -w -t -l +\\^P\\$ +\\011\\$ +.Ed +.Pp +Visualize string using URI encoding: +.Bd -literal -offset indent +$ echo http://www.freebsd.org | vis -h +http%3a%2f%2fwww.freebsd.org%0a +.Ed .Sh SEE ALSO .Xr unvis 1 , .Xr svis 3 , Index: usr.bin/colrm/colrm.1 =================================================================== --- usr.bin/colrm/colrm.1 +++ usr.bin/colrm/colrm.1 @@ -75,6 +75,26 @@ .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show columns below 3 (c) and above 5 (e) +.Bd -literal -offset indent +$ echo -e "abcdefgh\\n12345678" | colrm 3 5 +abfgh +12678 +.Ed +.Pp +Specifying a start column bigger than the number of columns in the file is +allowed and shows all the columns: +.Bd -literal -offset indent +$ echo "abcdefgh" | colrm 100 +abcdefgh +.Ed +.Pp +Using 1 as start column will show nothing: +.Bd -literal -offset indent +$ echo "abcdefgh" | colrm 1 + +.Ed .Sh SEE ALSO .Xr awk 1 , .Xr column 1 , Index: usr.bin/comm/comm.1 =================================================================== --- usr.bin/comm/comm.1 +++ usr.bin/comm/comm.1 @@ -95,6 +95,35 @@ .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Assuming a file named +.Pa example.txt +with the following contents: +.Bd -literal -offset indent +a +b +c +d +.Ed +.Pp +Show lines only in +.Pa example.txt , +lines only in stdin and common lines: +.Bd -literal -offset indent +$ echo -e "B\enc" | comm example.txt - + B +a +b + c +d +.Ed +.Pp +Show only common lines doing case insensitive comparisons: +.Bd -literal -offset indent +$ echo -e "B\enc" | comm -1 -2 -i example.txt - +b +c +.Ed .Sh SEE ALSO .Xr cmp 1 , .Xr diff 1 , @@ -108,9 +137,7 @@ .Pp The .Fl i -option is an extension to the -.Tn POSIX -standard. +option is an extension to the POSIX standard. .Sh HISTORY A .Nm Index: usr.bin/getent/getent.1 =================================================================== --- usr.bin/getent/getent.1 +++ usr.bin/getent/getent.1 @@ -103,6 +103,24 @@ .Ar database , or 3 if there is no support for enumeration on .Ar database . +.Sh EXAMPLES +Show entry for user sshd from the passwd database: +.Bd -literal -offset indent +$ getent passwd sshd +sshd:*:22:22:Secure Shell Daemon:/var/empty:/usr/sbin/nologin +.Ed +.Pp +Show entry for TCP from the protocols database: +.Bd -literal -offset indent +$ getent protocols tcp +tcp 6 TCP +.Ed +.Pp +Show entry for hosts with address ::1 from the hosts database: +.Bd -literal -offset indent +$ getent hosts ::1 +::1 localhost localhost.my.domain +.Ed .Sh SEE ALSO .Xr getutxent 3 , .Xr ethers 5 , @@ -123,7 +141,4 @@ .Nx 3.0 , and was imported into .Fx 7.0 . -It was based on the command of the same name in -.Tn Solaris -and -.Tn Linux . +It was based on the command of the same name in Solaris and Linux. Index: usr.bin/hexdump/hexdump.1 =================================================================== --- usr.bin/hexdump/hexdump.1 +++ usr.bin/hexdump/hexdump.1 @@ -242,8 +242,7 @@ Nonprinting characters are displayed as a single .Dq Cm \&. . .It Cm _u -Output US -.Tn ASCII +Output US ASCII characters, with the exception that control characters are displayed using the following, lower-case, names. Characters greater than 0xff, hexadecimal, are displayed as hexadecimal @@ -330,18 +329,59 @@ .Sh EXIT STATUS .Ex -std hexdump hd .Sh EXAMPLES -Display the input in perusal format: +Dump input in canonical (hex+ASCII) form: .Bd -literal -offset indent +$ echo "FreeBSD: The power to serve" | hexdump -C +00000000 46 72 65 65 42 53 44 3a 20 54 68 65 20 70 6f 77 |FreeBSD: The pow| +00000010 65 72 20 74 6f 20 73 65 72 76 65 0a |er to serve.| +0000001c +.Ed +.Pp +Same as above but skipping the first 4 bytes of stdin and interpreting only 3 +bytes of input: +.Bd -literal -offset indent +$ echo "FreeBSD: The power to serve" | hexdump -C -s 4 -n 3 +00000004 42 53 44 |BSD| +00000007 +.Ed +.Pp +Assuming a format file named +.Pa format.txt +with the following contents that specify a perusal format: +.Bd -literal -offset indent "%06.6_ao " 12/1 "%3_u " "\et\et" "%_p " "\en" .Ed .Pp -Implement the \-x option: +Dump input in canonical form using the format in +.Pa format.txt : .Bd -literal -offset indent +$ echo "FreeBSD" | hexdump -f format.txt -C +000000 F r e e B S D lf F r e e B S D . +00000000 46 72 65 65 42 53 44 0a |FreeBSD.| +00000008 +.Ed +.Pp +Assuming a format file named +.Pa format.txt +with the following contents that simulate the +.Fl x +option: +.Bd -literal -offset indent "%07.7_Ax\en" "%07.7_ax " 8/2 "%04x " "\en" .Ed +.Pp +Dump input in canonical form using the format in +.Pa format.txt : +.Bd -literal -offset indent +$ echo "FreeBSD: The power to serve" | hexdump -f format.txt -C +0000000 7246 6565 5342 3a44 5420 6568 7020 776f +00000000 46 72 65 65 42 53 44 3a 20 54 68 65 20 70 6f 77 |FreeBSD: The pow| +0000010 7265 7420 206f 6573 7672 0a65 +00000010 65 72 20 74 6f 20 73 65 72 76 65 0a |er to serve.| +0000001c +.Ed .Sh SEE ALSO -.Xr gdb 1 , .Xr od 1 Index: usr.bin/netstat/netstat.1 =================================================================== --- usr.bin/netstat/netstat.1 +++ usr.bin/netstat/netstat.1 @@ -744,7 +744,6 @@ .It Li F Ta Dv NETISR_SNP_FLAGS_M2FLOW Ta "Able to map mbuf to flow id" .El .El -.Pp .Ss GENERAL OPTIONS Some options have the general meaning: .Bl -tag -width flag @@ -798,6 +797,28 @@ attempts to resolve addresses and ports, and display them symbolically. .El +.Sh EXAMPLES +Show packet traffic information (packets, bytes, errors, packet drops, etc) for +interface re0 updated every 2 seconds and exit after 5 outputs: +.Bd -literal -offset indent +$ netstat -w 2 -q 5 -I re0 +.Ed +.Pp +Show statistics for ICMP on any interface: +.Bd -literal -offset indent +$ netstat -s -p icmp +.Ed +.Pp +Show routing tables: +.Bd -literal -offset indent +$ netstat -r +.Ed +.Pp +Same as above, but without resolving numeric addresses and port numbers to +names: +.Bd -literal -offset indent +$ netstat -rn +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr nfsstat 1 ,