svn commit: r362298 - head/usr.bin/nl
Author: fernape (ports committer) Date: Thu Jun 18 08:26:26 2020 New Revision: 362298 URL: https://svnweb.freebsd.org/changeset/base/362298 Log: nl(1): Add EXAMPLES section Add EXAMPLES section covering flags -b[ap] -n -i -s -v Approved by: bcr@ Differential Revision:Add EXAMPLES section covering flags -b[ap] -n -i -s -v Modified: head/usr.bin/nl/nl.1 Modified: head/usr.bin/nl/nl.1 == --- head/usr.bin/nl/nl.1Thu Jun 18 07:35:18 2020(r362297) +++ head/usr.bin/nl/nl.1Thu Jun 18 08:26:26 2020(r362298) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 4, 2014 +.Dd June 18, 2020 .Dt NL 1 .Os .Sh NAME @@ -230,6 +230,42 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Number all non-blank lines: +.Bd -literal -offset indent +$ echo -e "This is\\n\\n\\na simple text" | nl + 1 This is + + + 2 a simple text +.Ed +.Pp +Number all lines including blank ones, with right justified line numbers with +leading zeroes, starting at 2, with increment of 2 and a custom multi-character +separator: +.Bd -literal -offset indent +$ echo -e "This\\nis\\nan\\n\\n\\nexample" | nl -ba -n rz -i2 -s "->" -v2 +02->This +04->is +06->an +08-> +10-> +12->example +.Ed +.Pp +Number lines matching regular expression for an +.Em i +.No followed by either +.Em m +.No or +.Em n +.Bd -literal -offset indent +$ echo -e "This is\\na simple text\\nwith multiple\\nlines" | nl -bp'i[mn]' +This is + 1 a simple text +with multiple + 2 lines +.Ed .Sh SEE ALSO .Xr jot 1 , .Xr pr 1 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362299 - head/usr.bin/lockf
Author: fernape (ports committer) Date: Thu Jun 18 08:31:04 2020 New Revision: 362299 URL: https://svnweb.freebsd.org/changeset/base/362299 Log: lockf(1): Add EXAMPLES section * Add pretty small EXAMPLES section * While here, fix a warning in line 98 (new sentence in new line) Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D25205 Modified: head/usr.bin/lockf/lockf.1 Modified: head/usr.bin/lockf/lockf.1 == --- head/usr.bin/lockf/lockf.1 Thu Jun 18 08:26:26 2020(r362298) +++ head/usr.bin/lockf/lockf.1 Thu Jun 18 08:31:04 2020(r362299) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 7, 1998 +.Dd June 18, 2020 .Dt LOCKF 1 .Os .Sh NAME @@ -95,7 +95,8 @@ Causes .Nm to fail if the specified lock .Ar file -does not exist. If +does not exist. +If .Fl n is not specified, .Nm @@ -160,6 +161,25 @@ The did not exit normally, but may have been signaled or stopped. .El +.Sh EXAMPLES +The first job takes a lock and sleeps for 5 seconds in the background. +The second job tries to get the lock and timeouts after 1 second (PID numbers +will differ): +.Bd -literal -offset indent +$ lockf mylock sleep 5 & lockf -t 1 mylock echo "Success" +[1] 94410 +lockf: mylock: already locked +.Ed +.Pp +The first job takes a lock and sleeps for 1 second in the background. +The second job waits up to 5 seconds to take the lock and echoes the message on +success (PID numbers will differ): +.Bd -literal -offset indent +$ lockf mylock sleep 1 & lockf -t 5 mylock echo "Success" +[1] 19995 +Success +[1]+ Donelockf mylock sleep 1 +.Ed .Sh SEE ALSO .Xr flock 2 , .Xr lockf 3 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362318 - head/usr.bin/tee
Author: fernape (ports committer) Date: Thu Jun 18 10:48:37 2020 New Revision: 362318 URL: https://svnweb.freebsd.org/changeset/base/362318 Log: tee(1): Add EXAMPLES section Probably the simplest one ever. Approved by: gbe@, 0mp@ Differential Revision:https://reviews.freebsd.org/D25206 Modified: head/usr.bin/tee/tee.1 Modified: head/usr.bin/tee/tee.1 == --- head/usr.bin/tee/tee.1 Thu Jun 18 10:47:30 2020(r362317) +++ head/usr.bin/tee/tee.1 Thu Jun 18 10:48:37 2020(r362318) @@ -31,7 +31,7 @@ .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 13, 2007 +.Dd June 18, 2020 .Dt TEE 1 .Os .Sh NAME @@ -74,6 +74,12 @@ except in the event of the option. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Send echoed message both to stdout and to the greetings file: +.Bd -literal -offset indent +$ echo "Hello" | tee greetings.txt +Hello +.Ed .Sh STANDARDS The .Nm ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r362318 - head/usr.bin/tee
On Thu, Jun 18, 2020 at 12:56 PM Yuri Pankov wrote: > > Fernando Apesteguía wrote: > > Author: fernape (ports committer) > > Date: Thu Jun 18 10:48:37 2020 > > New Revision: 362318 > > URL: https://svnweb.freebsd.org/changeset/base/362318 > > > > Log: > >tee(1): Add EXAMPLES section > > > >Probably the simplest one ever. > > > >Approved by: gbe@, 0mp@ > >Differential Revision: https://reviews.freebsd.org/D25206 > > > > Modified: > >head/usr.bin/tee/tee.1 > > > > Modified: head/usr.bin/tee/tee.1 > > == > > --- head/usr.bin/tee/tee.1Thu Jun 18 10:47:30 2020(r362317) > > +++ head/usr.bin/tee/tee.1Thu Jun 18 10:48:37 2020(r362318) > > @@ -31,7 +31,7 @@ > > .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 > > .\" $FreeBSD$ > > .\" > > -.Dd November 13, 2007 > > +.Dd June 18, 2020 > > .Dt TEE 1 > > .Os > > .Sh NAME > > @@ -74,6 +74,12 @@ except in the event of the > > option. > > .Sh EXIT STATUS > > .Ex -std > > +.Sh EXAMPLES > > +Send echoed message both to stdout and to the greetings file: > > Should this be like the following, at least to get the filename right? > > Send echoed message both to stdout and to the file > .Pa greetings.txt : It is probably better. I'm not a src/docs committer. Do you want me to create a new review for this? > > > +.Bd -literal -offset indent > > +$ echo "Hello" | tee greetings.txt > > +Hello > > +.Ed > > .Sh STANDARDS > > The > > .Nm > > > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362328 - head/usr.bin/split
Author: fernape (ports committer) Date: Thu Jun 18 15:14:10 2020 New Revision: 362328 URL: https://svnweb.freebsd.org/changeset/base/362328 Log: split(1): Add EXAMPLES section Add EXAMPLES covering -d, -n and -p Include small explanation about the size of the chunks for the -n option Approved by: 0mp Differential Revision:https://reviews.freebsd.org/D25198 Modified: head/usr.bin/split/split.1 Modified: head/usr.bin/split/split.1 == --- head/usr.bin/split/split.1 Thu Jun 18 13:19:56 2020(r362327) +++ head/usr.bin/split/split.1 Thu Jun 18 15:14:10 2020(r362328) @@ -122,6 +122,12 @@ lines in length. Split file into .Ar chunk_count smaller files. +The first n - 1 files will be of size (size of +.Ar file +/ +.Ar chunk_count +) +and the last file will contain the remaining bytes. .It Fl p Ar pattern The file is split whenever an input line matches .Ar pattern , @@ -164,6 +170,36 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Split input into as many files as needed, so that each file contains at most 2 +lines: +.Bd -literal -offset indent +$ echo -e "first line\\nsecond line\\nthird line\\nforth line" | split -l2 +.Ed +.Pp +Split input in chunks of 10 bytes using numeric prefixes for file names. +This generates two files of 10 bytes (x00 and x01) and a third file (x02) with the +remaining 2 bytes: +.Bd -literal -offset indent +$ echo -e "This is 22 bytes long" | split -d -b10 +.Ed +.Pp +Split input generating 6 files: +.Bd -literal -offset indent +echo -e "This is 22 bytes long" | split -n 6 +.Ed +.Pp +Split input creating a new file every time a line matches the regular expression +for a +.Dq t +followed by either +.Dq a +or +.Dq u +thus creating two files: +.Bd -literal -offset indent +$ echo -e "stack\\nstock\\nstuck\\nanother line" | split -p 't[au]' +.Ed .Sh SEE ALSO .Xr csplit 1 , .Xr re_format 7 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362365 - head/sbin/md5
Author: fernape (ports committer) Date: Fri Jun 19 06:23:55 2020 New Revision: 362365 URL: https://svnweb.freebsd.org/changeset/base/362365 Log: md5(1): Add EXAMPLES section Add EXAMLES covering -c, -s and -r Approved by: bcr@, 0mp@ Differential Revision:https://reviews.freebsd.org/D25278 Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 == --- head/sbin/md5/md5.1 Fri Jun 19 05:54:15 2020(r362364) +++ head/sbin/md5/md5.1 Fri Jun 19 06:23:55 2020(r362365) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 15, 2020 +.Dd June 19, 2020 .Dt MD5 1 .Os .Sh NAME @@ -95,6 +95,48 @@ utilities exit 0 on success, and 2 if at least one file does not have the same hash as the .Fl c option. +.Sh EXAMPLES +Calculate the MD5 checksum of the string +.Dq Hello . +.Bd -literal -offset indent +$ md5 -s Hello +MD5 ("Hello") = 8b1a9953c4611296a827abf8c47804d7 +.Ed +.Pp +Same as above, but note the absence of the newline character in the input +string: +.Bd -literal -offset indent +$ echo -n Hello | md5 +8b1a9953c4611296a827abf8c47804d7 +.Ed +.Pp +Calculate the checksum of multiple files reversing the output: +.Bd -literal -offset indent +$ md5 -r /boot/loader.conf /etc/rc.conf +ada5f60f23af88ff95b8091d6d67bef6 /boot/loader.conf +d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf +.Ed +.Pp +Write the digest for +.Pa /boot/loader.conf +in a file named +.Pa digest . +Then calculate the checksum again and validate it against the checksum string +extracted from the +.Pa digest +file: +.Bd -literal -offset indent +$ md5 /boot/loader.conf > digest && md5 -c $(cut -f2 -d= digest) /boot/loader.conf +MD5 (/boot/loader.conf) = ada5f60f23af88ff95b8091d6d67bef6 +.Ed +.Pp +Same as above but comparing the digest against an invalid string +.Pq Dq randomstring , +which results in a failure. +.Bd -literal -offset indent +$ md5 -c randomstring /boot/loader.conf +MD5 (/boot/loader.conf) = ada5f60f23af88ff95b8091d6d67bef6 [ Failed ] +.Ed .Sh SEE ALSO .Xr cksum 1 , .Xr md5 3 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362367 - head/usr.bin/diff
Author: fernape (ports committer) Date: Fri Jun 19 06:48:16 2020 New Revision: 362367 URL: https://svnweb.freebsd.org/changeset/base/362367 Log: diff(1): Add EXAMPLES section Add examples for -r, -u, -N, -x, -q and -I Approved by: 0mp@ Differential Revision:https://reviews.freebsd.org/D25345 Modified: head/usr.bin/diff/diff.1 Modified: head/usr.bin/diff/diff.1 == --- head/usr.bin/diff/diff.1Fri Jun 19 06:35:57 2020(r362366) +++ head/usr.bin/diff/diff.1Fri Jun 19 06:48:16 2020(r362367) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd June 1, 2020 +.Dd June 19, 2020 .Dt DIFF 1 .Os .Sh NAME @@ -277,8 +277,7 @@ Produces a script similar to that of .Fl e , but in the opposite order and with a count of changed lines on each insert or delete command. -This is the form used by -.Xr rcsdiff 1 . +This is the form used by rcsdiff. .It Fl q -brief Just print a line when the files differ. Does not output a list of changes. @@ -613,6 +612,49 @@ Differences were found. .It >1 An error occurred. .El +.Sh EXAMPLES +Compare +.Pa old_dir +and +.Pa new_dir +recursively generating an unified diff and treating files found only in one +of those directories as new files: +.Bd -literal -offset indent +$ diff -ruN /path/to/old_dir /path/to/new_dir +.Ed +.Pp +Same as above but excluding files matching the expressions +.Dq *.h +and +.Dq *.c : +.Bd -literal -offset indent +$ diff -ruN -x '*.h' -x '*.c' /path/to/old_dir /path/to/new_dir +.Ed +.Pp +Show a single line indicating if the files differ: +.Bd -literal -offset indent +$ diff -q /boot/loader.conf /boot/defaults/loader.conf +Files /boot/loader.conf and /boot/defaults/loader.conf differ +.Ed +.Pp +Assuming a file named +.Pa example.txt +with the following contents: +.Bd -literal -offset indent +FreeBSD is an operating system +Linux is a kernel +OpenBSD is an operating system +.Ed +.Pp +Compare stdin with +.Pa example.txt +excluding from the comparison those lines containing either +.Qq Linux +or +.Qq Open : +.Bd -literal -offset indent +$ echo "FreeBSD is an operating system" | diff -q -I 'Linux|Open' example.txt - +.Ed .Sh SEE ALSO .Xr cmp 1 , .Xr comm 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362434 - head/usr.bin/cmp
Author: fernape (ports committer) Date: Sat Jun 20 11:20:16 2020 New Revision: 362434 URL: https://svnweb.freebsd.org/changeset/base/362434 Log: cmp(1): Add EXAMPLES section Add a small number of examples depicting the use of -l, -z and byte offsets Approved by: 0mp@ Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 == --- head/usr.bin/cmp/cmp.1 Sat Jun 20 08:22:57 2020(r362433) +++ head/usr.bin/cmp/cmp.1 Sat Jun 20 11:20:16 2020(r362434) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 16, 2020 +.Dd June 20, 2020 .Dt CMP 1 .Os .Sh NAME @@ -107,26 +107,33 @@ file (before any differences were found). An error occurred. .El .Sh EXAMPLES -Assuming a file named example.txt with the following contents: +Assuming a file named +.Pa example.txt +with the following contents: .Bd -literal -offset indent a b c .Ed .Pp -Compare stdin with example.txt: +Compare stdin with +.Pa example.txt : .Bd -literal -offset indent $ echo -e "a\\nb\\nc" | cmp - example.txt .Ed .Pp -Same as above but introducing a change in byte three in stdin. +Same as above but introducing a change in the third byte of stdin. Show the byte number (decimal) and differing byte (octal): .Bd -literal -offset indent $ echo -e "a\\nR\\nc" | cmp -l - example.txt 3 122 142 .Ed .Pp -Compare example.txt and /boot/loader.conf exiting if size differs. +Compare file sizes of +.Pa example.txt +and +.Pa /boot/loader.conf +and return 1 if they are not equal. Note that .Fl z can only be used with regular files: @@ -135,8 +142,10 @@ $ cmp -z example.txt /boot/loader.conf example.txt /boot/loader.conf differ: size .Ed .Pp -Compare stdin with file example.txt omitting the 4 first bytes from stdin and -the 2 first bytes from example.txt: +Compare stdin with +.Pa example.txt +omitting the first 4 bytes from stdin and the first 2 bytes from +.Pa example.txt : .Bd -literal -offset indent $ echo -e "a\\nR\\nb\\nc" | cmp - example.txt 4 2 .Ed ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362435 - head/usr.bin/seq
Author: fernape (ports committer) Date: Sat Jun 20 11:24:29 2020 New Revision: 362435 URL: https://svnweb.freebsd.org/changeset/base/362435 Log: seq(1): complete EXAMPLES section * Add a small description before the EXAMPLES that are already in the man page to explicitely state what we are trying to show instead of having the user guess what the example is doing. * Add two more examples to show usage of -s, -t and -f * mandoc -Tlint reports irrelevant use of .Tn so remove them since according to mdoc(7) it is there only for compatibility and should not be used in new manuals. Approved by: 0mp@ Modified: head/usr.bin/seq/seq.1 Modified: head/usr.bin/seq/seq.1 == --- head/usr.bin/seq/seq.1 Sat Jun 20 11:20:16 2020(r362434) +++ head/usr.bin/seq/seq.1 Sat Jun 20 11:24:29 2020(r362435) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2018 +.Dd June 20, 2020 .Dt SEQ 1 .Os .Sh NAME @@ -133,22 +133,51 @@ the default conversion is changed to .Sh EXIT STATUS .Ex -std .Sh EXAMPLES +Generate a sequence from 1 to 3 (included) with a default increment of 1: .Bd -literal -offset indent # seq 1 3 1 2 3 - +.Ed +.Pp +Generate a sequence from 3 to 1 (included) with a default increment of -1: +.Bd -literal -offset indent # seq 3 1 3 2 1 - +.Ed +.Pp +Generate a sequence from 0 to 0.1 (included) with an increment of 0.05 and padding +with leading zeroes. +.Bd -literal -offset indent # seq -w 0 .05 .1 0.00 0.05 0.10 .Ed +.Pp +Generate a sequence from 1 to 3 (included) with a default increment of 1, +a custom separator string and a custom terminator: +.Bd -literal -offset indent +# seq -s "-->" -t "[end of list]\\n" 1 3 +1-->2-->3-->[end of list] +.Ed +.Pp +Generate a sequence from 1 to 2 (included) with an increment of 0.2 and +print the results with two digits after the decimal point (using a +.Xr printf 3 +style format): +.Bd -literal -offset indent +# seq -f %.2f 1 0.2 2 +1.00 +1.20 +1.40 +1.60 +1.80 +2.00 +.Ed .Sh SEE ALSO .Xr jot 1 , .Xr printf 1 , @@ -165,12 +194,8 @@ command appeared in and was ported to .Fx 9.0 . This command was based on the command of the same name in -.Tn "Plan 9 from Bell Labs" -and the -.Tn GNU -core utilities. -The -.Tn GNU +Plan 9 from Bell Labs and the GNU core utilities. +The GNU .Nm command first appeared in the 1.13 shell utilities release. .Sh BUGS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362436 - head/usr.bin/join
Author: fernape (ports committer) Date: Sat Jun 20 11:27:59 2020 New Revision: 362436 URL: https://svnweb.freebsd.org/changeset/base/362436 Log: join(1): Add EXAMPLES section Add EXAMPLES covering options -e, -o, -t, -v, -1 Approved by: 0mp@ Differential Revision: https://reviews.freebsd.org/D25186 Modified: head/usr.bin/join/join.1 Modified: head/usr.bin/join/join.1 == --- head/usr.bin/join/join.1Sat Jun 20 11:24:29 2020(r362435) +++ head/usr.bin/join/join.1Sat Jun 20 11:27:59 2020(r362436) @@ -31,7 +31,7 @@ .\"@(#)join.1 8.3 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd July 5, 2004 +.Dd June 20, 2020 .Dt JOIN 1 .Os .Sh NAME @@ -164,6 +164,78 @@ is the standard input is used. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Assuming a file named +.Pa nobel_laureates.txt +with information about some of the first Nobel Peace Prize laureates: +.Bd -literal -offset indent +1901,Jean Henri Dunant,M +1901,Frederic Passy,M +1902,Elie Ducommun,M +1905,Baroness Bertha Sophie Felicita Von Suttner,F +1910,Permanent International Peace Bureau, +.Ed +.Pp +and a second file +.Pa nobel_nationalities.txt +with their nationalities: +.Bd -literal -offset indent +Jean Henri Dunant,Switzerland +Frederic Passy,France +Elie Ducommun,Switzerland +Baroness Bertha Sophie Felicita Von Suttner +.Ed +.Pp +Join the two files using the second column from first file and the default first +column from second file specifying a custom field delimiter: +.Bd -literal -offset indent +$ join -t, -1 2 nobel_laureates.txt nobel_nationalities.txt +Jean Henri Dunant,1901,M,Switzerland +Frederic Passy,1901,M,France +Elie Ducommun,1902,M,Switzerland +Baroness Bertha Sophie Felicita Von Suttner,1905,F +.Ed +.Pp +Show only the year and the nationality of the laureate using +.Ql <> +to replace empty fields: +.Bd -literal -offset indent +$ join -e "<>" -t, -1 2 -o "1.1 2.2" nobel_laureates.txt nobel_nationalities.txt +1901,Switzerland +1901,France +1902,Switzerland +1905,<> +.Ed +.Pp +Show only lines from first file which do not have a match in second file: +.Bd -literal -offset indent +$ join -v1 -t, -1 2 nobel_laureates.txt nobel_nationalities.txt +Permanent International Peace Bureau,1910, +.Ed +.Pp +Assuming a file named +.Pa capitals.txt +with the following content: +.Bd -literal -offset indent +Belgium,Brussels +France,Paris +Italy,Rome +Switzerland +.Ed +.Pp +Show the name and capital of the country where the laureate was born. +This example uses +.Pa nobel_nationalities.txt +as a bridge but does not show any information from that file. +Also see the note about +.Xr sort 1 +above to understand why we need to sort the intermediate result. +.Bd -literal -offset indent +$ join -t, -1 2 -o 1.2 2.2 nobel_laureates.txt nobel_nationalities.txt | \e +sort -k2 -t, | join -t, -e "<>" -1 2 -o 1.1 2.2 - capitals.txt +Elie Ducommun,<> +Jean Henri Dunant,<> +.Ed .Sh COMPATIBILITY For compatibility with historic versions of .Nm , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362533 - head/usr.bin/hexdump
Author: fernape (ports committer) Date: Tue Jun 23 07:48:48 2020 New Revision: 362533 URL: https://svnweb.freebsd.org/changeset/base/362533 Log: od(1): Add EXAMPLES section * Add two small examples showing the use of -a, -c, -j and -N * While here, remove obsolete .Tn reported by mandoc(1) Approved by: 0mp@ Differential Revision:https://reviews.freebsd.org/D25372 Modified: head/usr.bin/hexdump/od.1 Modified: head/usr.bin/hexdump/od.1 == --- head/usr.bin/hexdump/od.1 Tue Jun 23 07:33:29 2020(r362532) +++ head/usr.bin/hexdump/od.1 Tue Jun 23 07:48:48 2020(r362533) @@ -143,7 +143,7 @@ is a string containing one or more of the following ki .Bl -tag -width indent .It Cm a Named characters -.Pq Tn ASCII . +.Pq ASCII . Control characters are displayed using the following names: .Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ" .It "000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ" @@ -243,6 +243,24 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Dump stdin and show the output using named characters and C-style escaped +characters: +.Bd -literal -offset indent +$ echo "FreeBSD: The power to serve" | od -a -c +000F r e e B S D : sp T h e sp p o w + F r e e B S D : T h e p o w +020e r sp t o sp s e r v e nl + e r t o s e r v e \en +034 +.Ed +.Pp +Dump stdin skipping the first 13 bytes using named characters and dumping no +more than 5 bytes: +.Bd -literal -offset indent +$ echo "FreeBSD: The power to serve" | od -An -a -j 13 -N 5 + p o w e r +.Ed .Sh COMPATIBILITY The traditional .Fl s ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362534 - head/usr.bin/tee
Author: fernape (ports committer) Date: Tue Jun 23 10:05:07 2020 New Revision: 362534 URL: https://svnweb.freebsd.org/changeset/base/362534 Log: tee(1): Add EXAMPLES section Add one simple example Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D25337 Modified: head/usr.bin/tee/tee.1 Modified: head/usr.bin/tee/tee.1 == --- head/usr.bin/tee/tee.1 Tue Jun 23 07:48:48 2020(r362533) +++ head/usr.bin/tee/tee.1 Tue Jun 23 10:05:07 2020(r362534) @@ -31,7 +31,7 @@ .\" @(#)tee.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 18, 2020 +.Dd June 23, 2020 .Dt TEE 1 .Os .Sh NAME @@ -75,7 +75,9 @@ option. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -Send echoed message both to stdout and to the greetings file: +Send echoed message both to stdout and to the +.Pa greetings.txt +file: .Bd -literal -offset indent $ echo "Hello" | tee greetings.txt Hello ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362535 - head/usr.bin/colrm
Author: fernape (ports committer) Date: Tue Jun 23 10:15:08 2020 New Revision: 362535 URL: https://svnweb.freebsd.org/changeset/base/362535 Log: colrm(1): Add EXAMPLES section Add a couple of simple examples Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D25196 Modified: head/usr.bin/colrm/colrm.1 Modified: head/usr.bin/colrm/colrm.1 == --- head/usr.bin/colrm/colrm.1 Tue Jun 23 10:05:07 2020(r362534) +++ head/usr.bin/colrm/colrm.1 Tue Jun 23 10:15:08 2020(r362535) @@ -28,7 +28,7 @@ .\" @(#)colrm.18.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 2015 +.Dd June 23, 2020 .Dt COLRM 1 .Os .Sh NAME @@ -75,6 +75,26 @@ as described in .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\en12345678" | 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 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362615 - head/usr.bin/limits
Author: fernape (ports committer) Date: Thu Jun 25 16:46:27 2020 New Revision: 362615 URL: https://svnweb.freebsd.org/changeset/base/362615 Log: limits(1): Add EXAMPLES section * Add four examples showing flags -e, -b, -d, -s * Remove extra space at the end of the line reported by igor Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D25426 Modified: head/usr.bin/limits/limits.1 Modified: head/usr.bin/limits/limits.1 == --- head/usr.bin/limits/limits.1Thu Jun 25 15:25:00 2020 (r362614) +++ head/usr.bin/limits/limits.1Thu Jun 25 16:46:27 2020 (r362615) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2020 +.Dd June 25, 2020 .Dt LIMITS 1 .Os .Sh NAME @@ -376,6 +376,44 @@ exits with a status of .Dv EXIT_SUCCESS . When run in command mode and execution of the command succeeds, the exit status will be whatever the executed program returns. +.Sh EXAMPLES +Show current stack size limit: +.Bd -literal -offset indent +$ limits -s +Resource limits (current): + stacksize 524288 kB +.Ed +.Pp +Try to run +.Xr ls 1 +with 1 byte of +.Va datasize +limit: +.Bd -literal -offset indent +$ limits -d 1b ls +Data segment size exceeds process limit +Abort trap +.Ed +.Pp +Produce +.Ql eval mode +output to limit +.Va sbsize +to 1 byte. +Output obtained when command is run from +.Xr sh 1 : +.Bd -literal -offset indent +$ limits -e -b 1b +ulimit -b 512; +.Ed +.Pp +Same as above from +.Xr csh 1 +.Bd -literal -offset indent +% limits -e -b 1b +limit -h sbsize 512; +limit sbsize 512; +.Ed .Sh SEE ALSO .Xr csh 1 , .Xr env 1 , @@ -396,7 +434,7 @@ utility first appeared in The .Nm utility was written by -.An David Nugent Aq Mt dav...@freebsd.org . +.An David Nugent Aq Mt dav...@freebsd.org . .Sh BUGS The .Nm ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362677 - head/usr.bin/rev
Author: fernape (ports committer) Date: Sat Jun 27 11:19:18 2020 New Revision: 362677 URL: https://svnweb.freebsd.org/changeset/base/362677 Log: rev(1): Add EXAMPLES section Very simple example. Approved by: imp, 0mp, manpages(bcr) Differential Revision:https://reviews.freebsd.org/D25468 Modified: head/usr.bin/rev/rev.1 Modified: head/usr.bin/rev/rev.1 == --- head/usr.bin/rev/rev.1 Sat Jun 27 11:13:45 2020(r362676) +++ head/usr.bin/rev/rev.1 Sat Jun 27 11:19:18 2020(r362677) @@ -28,7 +28,7 @@ .\"@(#)rev.1 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd June 27, 2020 .Dt REV 1 .Os .Sh NAME @@ -43,3 +43,10 @@ The utility copies the specified files to the standard output, reversing the order of characters in every line. If no files are specified, the standard input is read. +.Sh EXAMPLES +Reverse the text from stdin: +.Bd -literal -offset indent +$ echo -e "reverse \et these\entwo lines" | rev +esehtesrever +senil owt +.Ed ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362678 - head/usr.bin/killall
Author: fernape (ports committer) Date: Sat Jun 27 11:28:11 2020 New Revision: 362678 URL: https://svnweb.freebsd.org/changeset/base/362678 Log: killall(1): Clarify -d, -s and -v options -d and -v are not equivalent options. The former is more verbose than the latter and the former does not actually send the signals while the latter does. Let them have their own paragraphs. From the point of view of the output, -v is equivalent to -s, so describe them close to each other. The difference is that former actually sends the signals and the latter doesn't. PR: 247411 Approved by: manpages(0mp) Differential Revision:https://reviews.freebsd.org/D25413 Modified: head/usr.bin/killall/killall.1 Modified: head/usr.bin/killall/killall.1 == --- head/usr.bin/killall/killall.1 Sat Jun 27 11:19:18 2020 (r362677) +++ head/usr.bin/killall/killall.1 Sat Jun 27 11:28:11 2020 (r362678) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2020 +.Dd June 27, 2020 .Dt KILLALL 1 .Os .Sh NAME @@ -58,13 +58,11 @@ The super-user is allowed to kill any process. .Pp The options are as follows: .Bl -tag -width ".Fl c Ar procname" -.It Fl d | v -Be more verbose about what will be done. -For a single -.Fl d -option, a list of the processes that will be sent the signal will be -printed, or a message indicating that no matching processes have been -found. +.It Fl d +Be more verbose about what will be done, but do not send any signal. +The total number of user processes and the real user ID is shown. +A list of the processes that will be sent the signal will be printed, or a +message indicating that no matching processes have been found. .It Fl e Use the effective user ID instead of the (default) real user ID for matching processes specified with the @@ -86,8 +84,12 @@ of processes found. CAUTION! This is dangerous, a single dot will match any process running under the real UID of the caller. +.It Fl v +Be verbose about what will be done. .It Fl s -Show only what would be done, but do not send any signal. +Same as +.Fl v , +but do not send any signal. .It Fl Ar SIGNAL Send a different signal instead of the default .Dv TERM . @@ -190,9 +192,9 @@ to all processes matching provided pattern (like vim a killall -m 'vim*' .Ed .Sh DIAGNOSTICS -Diagnostic messages will only be printed if requested by +Diagnostic messages will only be printed if the .Fl d -options. +flag is used. .Sh SEE ALSO .Xr kill 1 , .Xr pkill 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362783 - head/usr.bin/hexdump
Author: fernape (ports committer) Date: Mon Jun 29 15:15:14 2020 New Revision: 362783 URL: https://svnweb.freebsd.org/changeset/base/362783 Log: hexdump(1): Add EXAMPLES section * Add examples showing the use of -f, -C, -s, -n * Rework the two already present examples that were *format* examples * Remove .Tn suggested by mandoc(1) * Remove reference to gdb(1) since it is not present in current Approved by: manpages (gbe) Differential Revision:https://reviews.freebsd.org/D25406 Modified: head/usr.bin/hexdump/hexdump.1 Modified: head/usr.bin/hexdump/hexdump.1 == --- head/usr.bin/hexdump/hexdump.1 Mon Jun 29 13:30:48 2020 (r362782) +++ head/usr.bin/hexdump/hexdump.1 Mon Jun 29 15:15:14 2020 (r362783) @@ -28,7 +28,7 @@ .\"@(#)hexdump.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 29, 2014 +.Dd June 29, 2020 .Dt HEXDUMP 1 .Os .Sh NAME @@ -242,8 +242,7 @@ Output characters in the default character set. 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 @@ option. .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 + 46 72 65 65 42 53 44 3a 20 54 68 65 20 70 6f 77 |FreeBSD: The pow| +0010 65 72 20 74 6f 20 73 65 72 76 65 0a |er to serve.| +001c +.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 +0004 42 53 44 |BSD| +0007 +.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 +00 F r e e B S D lf F r e e B S D . + 46 72 65 65 42 53 44 0a |FreeBSD.| +0008 +.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 +000 7246 6565 5342 3a44 5420 6568 7020 776f + 46 72 65 65 42 53 44 3a 20 54 68 65 20 70 6f 77 |FreeBSD: The pow| +010 7265 7420 206f 6573 7672 0a65 +0010 65 72 20 74 6f 20 73 65 72 76 65 0a |er to serve.| +001c +.Ed .Sh SEE ALSO -.Xr gdb 1 , .Xr od 1 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362843 - head/usr.bin/printf
Author: fernape (ports committer) Date: Wed Jul 1 16:33:32 2020 New Revision: 362843 URL: https://svnweb.freebsd.org/changeset/base/362843 Log: printf(1): Add EXAMPLES section * Small addition with four simple examples * While here, remove three obsolete .Tn macros Approved by: manpages (gbe) Differential Revision:https://reviews.freebsd.org/D25462 Modified: head/usr.bin/printf/printf.1 Modified: head/usr.bin/printf/printf.1 == --- head/usr.bin/printf/printf.1Wed Jul 1 16:18:35 2020 (r362842) +++ head/usr.bin/printf/printf.1Wed Jul 1 16:33:32 2020 (r362843) @@ -31,7 +31,7 @@ .\"@(#)printf.18.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 29, 2019 +.Dd July 1, 2020 .Dt PRINTF 1 .Os .Sh NAME @@ -316,12 +316,48 @@ Consult the manual page. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Print the string +.Qq hello : +.Bd -literal -offset indent +$ printf "%s\en" hello +hello +.Ed +.Pp +Same as above, but notice that the format string is not quoted and hence we +do not get the expected behavior: +.Bd -literal -offset indent +$ printf %s\en hello +hellon$ +.Ed +.Pp +Print arguments forcing sign only for the first argument: +.Bd -literal -offset indent +$ printf "%+d\en%d\en%d\en" 1 -2 13 ++1 +-2 +13 +.Ed +.Pp +Same as above, but the single format string will be applied to the three +arguments: +.Bd -literal -offset indent +$ printf "%+d\en" 1 -2 13 ++1 +-2 ++13 +.Ed +.Pp +Print number using only two digits after the decimal point: +.Bd -literal -offset indent +$ printf "%.2f\en" 31.7456 +31.75 +.Ed .Sh COMPATIBILITY The traditional .Bx behavior of converting arguments of numeric formats not beginning -with a digit to the -.Tn ASCII +with a digit to the ASCII code of the first character is not supported. .Sh SEE ALSO .Xr builtin 1 , @@ -343,8 +379,7 @@ It is modeled after the standard library function, .Xr printf 3 . .Sh CAVEATS -.Tn ANSI -hexadecimal character constants were deliberately not provided. +ANSI hexadecimal character constants were deliberately not provided. .Pp Trying to print a dash ("-") as the first character causes .Nm @@ -364,10 +399,8 @@ and formats with a precision may not operate as expected. .Sh BUGS -Since the floating point numbers are translated from -.Tn ASCII -to floating-point and -then back again, floating-point precision may be lost. +Since the floating point numbers are translated from ASCII +to floating-point and then back again, floating-point precision may be lost. (By default, the number is translated to an IEEE-754 double-precision value before being printed. The ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362992 - head/usr.bin/time
Author: fernape (ports committer) Date: Tue Jul 7 16:07:39 2020 New Revision: 362992 URL: https://svnweb.freebsd.org/changeset/base/362992 Log: time(1): Add EXAMPLES section Add EXAMPLES showing all five flags: -a, -h, -l, -o, -p Approved by: manpages (bcr) Modified: head/usr.bin/time/time.1 Modified: head/usr.bin/time/time.1 == --- head/usr.bin/time/time.1Tue Jul 7 13:51:16 2020(r362991) +++ head/usr.bin/time/time.1Tue Jul 7 16:07:39 2020(r362992) @@ -28,7 +28,7 @@ .\" @(#)time.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 14, 2006 +.Dd July 7, 2020 .Dt TIME 1 .Os .Sh NAME @@ -129,6 +129,62 @@ If .Nm encounters any other error, the exit status is between 1 and 125 included. +.Sh EXAMPLES +Time the execution of +.Xr ls 1 +on an empty directory: +.Bd -literal -offset indent +$ /usr/bin/time ls +0.00 real 0.00 user 0.00 sys +.Ed +.Pp +Time the execution of the +.Xr cp 1 +command and store the result in the +.Pa times.txt +file. +Then execute the command again to make a new copy and add the result to the same +file: +.Bd -literal -offset indent +$ /usr/bin/time -o times.txt cp FreeBSD-12.1-RELEASE-amd64-bootonly.iso copy1.iso +$ /usr/bin/time -a -o times.txt cp FreeBSD-12.1-RELEASE-amd64-bootonly.iso copy2.iso +.Ed +.Pp +The +.Pa times.txt +file will contain the times of both commands: +.Bd -literal -offset indent +$ cat times.txt +0.68 real 0.00 user 0.22 sys +0.67 real 0.00 user 0.21 sys +.Ed +.Pp +Time the +.Xr sleep 1 +command and show the results in a human friendly format. +Show the contents of the +.Em rusage +structure too: +.Bd -literal -offset indent +$ /usr/bin/time -l -h -p sleep 5 +real 5.01 +user 0.00 +sys 0.00 + 0 maximum resident set size + 0 average shared memory size + 0 average unshared data size + 0 average unshared stack size +80 page reclaims + 0 page faults + 0 swaps + 1 block input operations + 0 block output operations + 0 messages sent + 0 messages received + 0 signals received + 3 voluntary context switches + 0 involuntary context switches +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr csh 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362994 - head/usr.bin/timeout
Author: fernape (ports committer) Date: Tue Jul 7 17:02:23 2020 New Revision: 362994 URL: https://svnweb.freebsd.org/changeset/base/362994 Log: timeout(1): Add EXAMPLES section Small EXAMPLES section showing the use of -s, -k and the different exit values Approved by: manpages (gbe) Differential Revision:https://reviews.freebsd.org/D25575 Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 == --- head/usr.bin/timeout/timeout.1 Tue Jul 7 16:35:52 2020 (r362993) +++ head/usr.bin/timeout/timeout.1 Tue Jul 7 17:02:23 2020 (r362994) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2018 +.Dd July 7, 2020 .Dt TIMEOUT 1 .Os .Sh NAME @@ -136,6 +136,62 @@ If an invalid parameter is passed to or .Fl k , the exit status returned is 125. +.Sh EXAMPLES +Run +.Xr sleep 1 +with a time limit of 4 seconds. +Since the command completes in 2 seconds, the exit status is 0: +.Bd -literal -offset indent +$ timeout 4 sleep 2 +$ echo $? +0 +.Ed +.Pp +Run +.Xr sleep 1 +for 4 seconds and terminate process after 2 seconds. +124 is returned since no +.Fl -preserve-status +is used: +.Bd -literal -offset indent +$ timeout 2 sleep 4 +$ echo $? +124 +.Ed +.Pp +Same as above but preserving status. +Exit status is 128 + signal number (15 for +.Va SIGTERM ) +.Bd -literal -offset indent +$ timeout --preserve-status 2 sleep 4 +$ echo $? +143 +.Ed +.Pp +Same as above but sending +.Va SIGALRM +(signal number 14) instead of +.Va SIGTERM +.Bd -literal -offset indent +$ timeout --preserve-status -s SIGALRM 2 sleep 4 +$ echo $? +142 +.Ed +.Pp +Try to +.Xr fetch 1 +the single page version of the +.Fx +Handbook. +Send a +.Va SIGTERM +signal after 1 minute and send a +.Va SIGKILL +signal 5 seconds later if the process refuses to stop: +.Bd -literal -offset indent +timeout -k 5s 1m fetch \\ +https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html +.Ed .Sh SEE ALSO .Xr kill 1 , .Xr signal 3 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r363396 - head/usr.bin/netstat
Author: fernape (ports committer) Date: Tue Jul 21 16:17:23 2020 New Revision: 363396 URL: https://svnweb.freebsd.org/changeset/base/363396 Log: netstat(1): Add EXAMPLES section * Add small EXAMPLES section * Fix warning reported by mandoc (./netstat.1:747:2: WARNING: skipping paragraph macro: Pp before Ss) Approved by: manpages (gbe) Differential Revision: https://reviews.freebsd.org/D25212 Modified: head/usr.bin/netstat/netstat.1 Modified: head/usr.bin/netstat/netstat.1 == --- head/usr.bin/netstat/netstat.1 Tue Jul 21 15:03:36 2020 (r363395) +++ head/usr.bin/netstat/netstat.1 Tue Jul 21 16:17:23 2020 (r363396) @@ -28,7 +28,7 @@ .\"@(#)netstat.1 8.8 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd March 22, 2018 +.Dd July 21, 2020 .Dt NETSTAT 1 .Os .Sh NAME @@ -744,7 +744,6 @@ The flags field shows available ISR handlers: .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 @@ Normally 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 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r363611 - head/usr.bin/truncate
Author: fernape (ports committer) Date: Mon Jul 27 15:25:04 2020 New Revision: 363611 URL: https://svnweb.freebsd.org/changeset/base/363611 Log: truncate(1): Add EXAMPLES section Add four simple examples showing the use of -c, -r and -s Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D25774 Modified: head/usr.bin/truncate/truncate.1 Modified: head/usr.bin/truncate/truncate.1 == --- head/usr.bin/truncate/truncate.1Mon Jul 27 15:09:07 2020 (r363610) +++ head/usr.bin/truncate/truncate.1Mon Jul 27 15:25:04 2020 (r363611) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2006 +.Dd July 27, 2020 .Dt TRUNCATE 1 .Os .Sh NAME @@ -143,6 +143,43 @@ If the operation fails for an argument, .Nm will issue a diagnostic and continue processing the remaining arguments. +.Sh EXAMPLES +Adjust the size of the file +.Pa test_file +to 10 Megabytes but do not create it if it does not exist: +.Bd -literal -offset indent +truncate -c -s +10M test_file +.Ed +.Pp +Same as above but create the file if it does not exist: +.Bd -literal -offset indent +truncate -s +10M test_file +ls -l test_file +-rw-r--r-- 1 root wheel 10485760 Jul 22 18:48 test_file +.Ed +.Pp +Adjust the size of +.Pa test_file +to the size of the kernel and create another file +.Pa test_file2 +with the same size: +.Bd -literal -offset indent +truncate -r /boot/kernel/kernel test_file test_file2 +ls -l /boot/kernel/kernel test_file* +-r-xr-xr-x 1 root wheel31352552 May 15 14:18 /boot/kernel/kernel* +-rw-r--r-- 1 root wheel31352552 Jul 22 19:15 test_file +-rw-r--r-- 1 root wheel31352552 Jul 22 19:15 test_file2 +.Ed +.Pp +Downsize +.Pa test_file +in 5 Megabytes: +.Bd -literal -offset indent +# truncate -s -5M test_file +ls -l test_file* +-rw-r--r-- 1 root wheel26109672 Jul 22 19:17 test_file +-rw-r--r-- 1 root wheel31352552 Jul 22 19:15 test_file2 +.Ed .Sh SEE ALSO .Xr dd 1 , .Xr touch 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r363620 - head/usr.bin/comm
Author: fernape (ports committer) Date: Mon Jul 27 16:51:23 2020 New Revision: 363620 URL: https://svnweb.freebsd.org/changeset/base/363620 Log: comm(1): Add EXAMPLES section Add two very simple examples. Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D25344 Modified: head/usr.bin/comm/comm.1 Modified: head/usr.bin/comm/comm.1 == --- head/usr.bin/comm/comm.1Mon Jul 27 16:37:18 2020(r363619) +++ head/usr.bin/comm/comm.1Mon Jul 27 16:51:23 2020(r363620) @@ -31,7 +31,7 @@ .\" From: @(#)comm.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 12, 2009 +.Dd July 27, 2020 .Dt COMM 1 .Os .Sh NAME @@ -95,6 +95,35 @@ as described in .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 @@ utility conforms to .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 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364350 - head/usr.bin/w
Author: fernape (ports committer) Date: Tue Aug 18 16:58:37 2020 New Revision: 364350 URL: https://svnweb.freebsd.org/changeset/base/364350 Log: uptime(1): Add EXAMPLES section Add a simple example Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26063 Modified: head/usr.bin/w/uptime.1 Modified: head/usr.bin/w/uptime.1 == --- head/usr.bin/w/uptime.1 Tue Aug 18 16:51:04 2020(r364349) +++ head/usr.bin/w/uptime.1 Tue Aug 18 16:58:37 2020(r364350) @@ -28,7 +28,7 @@ .\" @(#)uptime.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd April 18, 1994 +.Dd August 18, 2020 .Dt UPTIME 1 .Os .Sh NAME @@ -48,6 +48,11 @@ the number of users, and the load average of the syste .It Pa /boot/kernel/kernel system name list .El +.Sh EXAMPLES +.Bd -literal -offset indent +$ uptime +11:23AM up 3:01, 8 users, load averages: 21.09, 15.43, 12.79 +.Ed .Sh SEE ALSO .Xr w 1 .Sh HISTORY ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364459 - head/sbin/ipfw
Author: fernape (ports committer) Date: Fri Aug 21 17:45:17 2020 New Revision: 364459 URL: https://svnweb.freebsd.org/changeset/base/364459 Log: ipfw(8): Fix typo in man page s/exmaple/example Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26147 Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 == --- head/sbin/ipfw/ipfw.8 Fri Aug 21 16:17:18 2020(r364458) +++ head/sbin/ipfw/ipfw.8 Fri Aug 21 17:45:17 2020(r364459) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2020 +.Dd August 21, 2020 .Dt IPFW 8 .Os .Sh NAME @@ -4566,7 +4566,7 @@ rule will be performed as soon as rule is matched. In rule packet need to be passed to NAT, not allowed as soon is possible. .Pp There is example of set of rules to achieve this. Bear in mind that this -is exmaple only and it is not very useful by itself. +is example only and it is not very useful by itself. .Pp On way out, after all checks place this rules: .Pp ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364481 - head/sbin/sysctl
Author: fernape (ports committer) Date: Sat Aug 22 11:59:14 2020 New Revision: 364481 URL: https://svnweb.freebsd.org/changeset/base/364481 Log: sysctl(8): clarify -n flag -n omits the name of the variable regardless of the type of information that is requested. Rephrase to clarify this point. PR: 242191 Submitted by: stil...@gmail.com Approved by: emaste@ Differential Revision:https://reviews.freebsd.org/D26149 Modified: head/sbin/sysctl/sysctl.8 Modified: head/sbin/sysctl/sysctl.8 == --- head/sbin/sysctl/sysctl.8 Sat Aug 22 10:55:55 2020(r364480) +++ head/sbin/sysctl/sysctl.8 Sat Aug 22 11:59:14 2020(r364481) @@ -28,7 +28,7 @@ .\"From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 8, 2019 +.Dd August 22, 2020 .Dt SYSCTL 8 .Os .Sh NAME @@ -123,7 +123,7 @@ use: .Pp .Dl "complete sysctl 'n/*/`sysctl -Na`/'" .It Fl n -Show only variable values, not their names. +Do not show variable names. This option is useful for setting shell variables. For instance, to save the pagesize in variable .Va psize , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364719 - head/usr.bin/w
Author: fernape (ports committer) Date: Mon Aug 24 17:57:08 2020 New Revision: 364719 URL: https://svnweb.freebsd.org/changeset/base/364719 Log: w(1): Add EXAMPLES to man page Add small example section showing general use and -d and -h flags Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26172 Modified: head/usr.bin/w/w.1 Modified: head/usr.bin/w/w.1 == --- head/usr.bin/w/w.1 Mon Aug 24 17:43:23 2020(r364718) +++ head/usr.bin/w/w.1 Mon Aug 24 17:57:08 2020(r364719) @@ -28,7 +28,7 @@ .\" @(#)w.18.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd August 24, 2020 .Dt W 1 .Os .Sh NAME @@ -99,6 +99,41 @@ names are specified, the output is restricted to those .It Pa /var/run/utx.active list of users on the system .El +.Sh EXAMPLES +Show global activity of the system: +.Bd -literal -offset indent +$ w + 8:05PM up 35 mins, 3 users, load averages: 0.09, 0.35, 0.27 +USER TTY FROMLOGIN@ IDLE WHAT +fernapev0 - 7:30PM - tmux: client (/tmp/tmux-1001/default) (tmux) +root v1 - 8:03PM 1 -bash (bash) +fernapepts/0tmux(1391).%0 8:04PM - w +.Ed +.Pp +Show the entire process list per tty: +.Bd -literal -offset indent +$ w -d + 8:12PM up 42 mins, 3 users, load averages: 0.01, 0.11, 0.17 +USER TTY FROMLOGIN@ IDLE WHAT +1199 login [pam] (login) +1207 -bash (bash) +1507 tmux: client (/tmp/tmux-1001/default) (tmux) +fernapev0 - 7:30PM - tmux: client (/tmp/tmux-1001/default) (tmux) +1488 login [pam] (login) +1489 -bash (bash) +root v1 - 8:08PM 3 -bash (bash) +1510 -bash (bash) +1515 w -d +fernapepts/0tmux(1509).%0 8:11PM - w -d +.Ed +.Pp +Same as above but only for the root user and omitting the heading: +.Bd -literal -offset indent +$ w -d -h root + 1183 login [pam] (login) + 1204 -bash (bash) +root v1 - 7:15PM - -bash (bash) +.Ed .Sh COMPATIBILITY The .Fl f , @@ -137,9 +172,7 @@ to ignore interrupts. prints .Ql \- . ) .Pp -The -.Tn CPU -time is only an estimate, in particular, if someone leaves a background +The CPU time is only an estimate, in particular, if someone leaves a background process running after logging out, the person currently on that terminal is .Dq charged with the time. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366895 - head/usr.bin/compress
Author: fernape (ports committer) Date: Tue Oct 20 13:05:25 2020 New Revision: 366895 URL: https://svnweb.freebsd.org/changeset/base/366895 Log: compress(1): Add EXAMPLES section Add 5 examples showing basic usage. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26865 Modified: head/usr.bin/compress/compress.1 Modified: head/usr.bin/compress/compress.1 == --- head/usr.bin/compress/compress.1Tue Oct 20 11:49:19 2020 (r366894) +++ head/usr.bin/compress/compress.1Tue Oct 20 13:05:25 2020 (r366895) @@ -32,7 +32,7 @@ .\" @(#)compress.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 17, 2002 +.Dd October 20, 2020 .Dt COMPRESS 1 .Os .Sh NAME @@ -186,6 +186,40 @@ utility exits 2 if attempting to compress a file would and the .Fl f option was not specified and if no other error occurs. +.Sh EXAMPLES +Create a file +.Pa test_file +with a single line of text: +.Bd -literal -offset indent +echo "This is a test" > test_file +.Ed +.Pp +Try to reduce the size of the file using a 10-bit code and show the exit status: +.Bd -literal -offset indent +$ compress -b 10 test_file +$ echo $? +2 +.Ed +.Pp +Try to compress the file and show compression percentage: +.Bd -literal -offset indent +$ compress -v test_file +test_file: file would grow; left unmodified +.Ed +.Pp +Same as above but forcing compression: +.Bd -literal -offset indent +$ compress -f -v test_file +test_file.Z: 79% expansion +.Ed +.Pp +Compress and uncompress the string +.Ql hello +on the fly: +.Bd -literal -offset indent +$ echo "hello" | compress | uncompress +hello +.Ed .Sh SEE ALSO .Xr gunzip 1 , .Xr gzexe 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366896 - head/bin/realpath
Author: fernape (ports committer) Date: Tue Oct 20 13:15:26 2020 New Revision: 366896 URL: https://svnweb.freebsd.org/changeset/base/366896 Log: realpath(1): Add EXAMPLES section. Add a small example for this simple command. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26863 Modified: head/bin/realpath/realpath.1 Modified: head/bin/realpath/realpath.1 == --- head/bin/realpath/realpath.1Tue Oct 20 13:05:25 2020 (r366895) +++ head/bin/realpath/realpath.1Tue Oct 20 13:15:26 2020 (r366896) @@ -69,6 +69,14 @@ is specified, warnings will not be printed when fails. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show the physical path of the +.Pa /dev/log +directory silencing warnings if any: +.Bd -literal -offset indent +$ realpath -q /dev/log +/var/run/log +.Ed .Sh SEE ALSO .Xr realpath 3 .Sh HISTORY ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366913 - head/usr.bin/col
Author: fernape (ports committer) Date: Wed Oct 21 16:30:34 2020 New Revision: 366913 URL: https://svnweb.freebsd.org/changeset/base/366913 Log: col(1): Add EXAMPLES section Add a small example. Cross reference clean up for colcrt, nroff and tbl. Reviewed by: gbe@, bcr@ Approved by: gbe@ Differential Revision:https://reviews.freebsd.org/D26864 Modified: head/usr.bin/col/col.1 Modified: head/usr.bin/col/col.1 == --- head/usr.bin/col/col.1 Wed Oct 21 16:04:57 2020(r366912) +++ head/usr.bin/col/col.1 Wed Oct 21 16:30:34 2020(r366913) @@ -31,7 +31,7 @@ .\" @(#)col.1 8.1 (Berkeley) 6/29/93 .\" $FreeBSD$ .\" -.Dd May 10, 2015 +.Dd October 21, 2020 .Dt COL 1 .Os .Sh NAME @@ -47,10 +47,6 @@ The utility filters out reverse (and half reverse) line feeds so that the output is in the correct order with only forward and half forward line feeds, and replaces white-space characters with tabs where possible. -This can be useful in processing the output of -.Xr nroff 1 -and -.Xr tbl 1 . .Pp The .Nm @@ -149,11 +145,19 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +We can use +.Nm +to filter the output of +.Xr man 1 +and remove the backspace characters ( +.Em ^H +) before searching for some text: +.Bd -literal -offset indent +man ls | col -b | grep HISTORY +.Ed .Sh SEE ALSO -.Xr colcrt 1 , -.Xr expand 1 , -.Xr nroff 1 , -.Xr tbl 1 +.Xr expand 1 .Sh STANDARDS The .Nm ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367011 - head/usr.bin/getent
Author: fernape (ports committer) Date: Sat Oct 24 16:40:34 2020 New Revision: 367011 URL: https://svnweb.freebsd.org/changeset/base/367011 Log: getent(1): Add EXAMPLES section Add 3 small examples to the EXAMPLES section. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26866 Modified: head/usr.bin/getent/getent.1 Modified: head/usr.bin/getent/getent.1 == --- head/usr.bin/getent/getent.1Sat Oct 24 16:25:52 2020 (r367010) +++ head/usr.bin/getent/getent.1Sat Oct 24 16:40:34 2020 (r367011) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2016 +.Dd October 24, 2020 .Dt GETENT 1 .Os .Sh NAME @@ -103,6 +103,24 @@ utility exits 0 on success, .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 the localhost IPv6 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 @@ command appeared in .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. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367012 - head/bin/pwd
Author: fernape (ports committer) Date: Sat Oct 24 16:42:35 2020 New Revision: 367012 URL: https://svnweb.freebsd.org/changeset/base/367012 Log: pwd(1): Add EXAMPLES section Small EXAMPLES section. Add reference to realpath(1) due to similarity. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26862 Modified: head/bin/pwd/pwd.1 Modified: head/bin/pwd/pwd.1 == --- head/bin/pwd/pwd.1 Sat Oct 24 16:40:34 2020(r367011) +++ head/bin/pwd/pwd.1 Sat Oct 24 16:42:35 2020(r367012) @@ -32,7 +32,7 @@ .\" @(#)pwd.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd October 24, 2020 .Dt PWD 1 .Os .Sh NAME @@ -74,10 +74,30 @@ Logical current working directory. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show current working directory with symbolic links resolved: +.Bd -literal -offset indent +$ /bin/pwd +/usr/home/fernape +.Ed +.Pp +Show the logical current directory. +Then use +.Xr file 1 +to inspect the +.Pa /home +directory: +.Bd -literal -offset indent +$ /bin/pwd -L +/home/fernape +$ file /home +/home: symbolic link to usr/home +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr cd 1 , .Xr csh 1 , +.Xr realpath 1 , .Xr sh 1 , .Xr getcwd 3 .Sh STANDARDS ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367077 - head/usr.bin/renice
Author: fernape (ports committer) Date: Tue Oct 27 12:32:17 2020 New Revision: 367077 URL: https://svnweb.freebsd.org/changeset/base/367077 Log: renice(8): Clarify "who" parameters. There was a question raised in freebsd-questions@ mail list[1] about the "who" parameters in this man page. It seems OpenBSD[2] amd NetBSD[3] both have more legible descriptions so I borrowed some of their ideas to try and make this page clearer. [1] https://lists.freebsd.org/pipermail/freebsd-questions/2020-October/291914.html [2] https://man.bsd.lv/renice [3] https://man.netbsd.org/renice.8 Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26950 Modified: head/usr.bin/renice/renice.8 Modified: head/usr.bin/renice/renice.8 == --- head/usr.bin/renice/renice.8Tue Oct 27 12:27:26 2020 (r367076) +++ head/usr.bin/renice/renice.8Tue Oct 27 12:32:17 2020 (r367077) @@ -28,7 +28,7 @@ .\" @(#)renice.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd October 27, 2020 .Dt RENICE 8 .Os .Sh NAME @@ -37,22 +37,18 @@ .Sh SYNOPSIS .Nm .Ar priority -.Op Oo Fl p Oc Ar pid ... -.Op Oo Fl g Oc Ar pgrp ... -.Op Oo Fl u Oc Ar user ... +.Op Oo Fl gpu Oc Ar target .Nm .Fl n Ar increment -.Op Oo Fl p Oc Ar pid ... -.Op Oo Fl g Oc Ar pgrp ... -.Op Oo Fl u Oc Ar user ... +.Op Oo Fl gpu Oc Ar target .Sh DESCRIPTION The .Nm utility alters the scheduling priority of one or more running processes. The following -.Ar who -parameters are interpreted as process ID's, process group +.Ar target +parameters are interpreted as process ID's (the default), process group ID's, user ID's or user names. The .Nm Ns 'ing @@ -62,27 +58,25 @@ The .Nm Ns 'ing of a user causes all processes owned by the user to have their scheduling priority altered. -By default, the processes to be affected are specified by -their process ID's. .Pp The following options are available: .Bl -tag -width indent -.It Fl g -Force -.Ar who -parameters to be interpreted as process group ID's. .It Fl n Instead of changing the specified processes to the given priority, interpret the following argument as an increment to be applied to the current priority of each process. -.It Fl u -Force the -.Ar who -parameters to be interpreted as user names or user ID's. +.It Fl g +Interpret +.Ar target +parameters as process group ID's. .It Fl p -Reset the -.Ar who -interpretation to be (the default) process ID's. +Interpret +.Ar target +parameters as process ID's (the default). +.It Fl u +Interpret +.Ar target +parameters as user names or user ID's. .El .Pp Users other than the super-user may only alter the priority of ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367141 - head/usr.bin/fetch
Author: fernape (ports committer) Date: Thu Oct 29 18:34:47 2020 New Revision: 367141 URL: https://svnweb.freebsd.org/changeset/base/367141 Log: fetch(1): Add EXAMPLES section Add a few examples covering flags: 1, R, a, o, q, r, s, v Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26946 Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Thu Oct 29 18:29:22 2020(r367140) +++ head/usr.bin/fetch/fetch.1 Thu Oct 29 18:34:47 2020(r367141) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2018 +.Dd October 29, 2020 .Dt FETCH 1 .Os .Sh NAME @@ -384,6 +384,51 @@ If the argument is used and the remote file is not newer than the specified file then the command will still return success, although no file is transferred. +.Sh EXAMPLES +Silently try to fetch the URLs passed as parameters. +The first one will fail. +If the second URL succeeds the third one will not be tried: +.Bd -literal -offset indent +$ fetch -1 -q https://www.freebsd.org/bad.html \\ + ftp.freebsd.org/pub/FreeBSD/README.TXT \\ + https://www.fake.url +fetch: https://www.freebsd.org/bad.html: Not Found +.Ed +.Pp +Be verbose when retrieving the +.Ql README.TXT +file: +.Bd -literal -offset indent +$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT +resolving server address: ftp.freebsd.org:80 +requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT +local size / mtime: 4259 / 1431015519 +remote size / mtime: 4259 / 1431015519 +README.TXT4259 B 44 MBps00s +.Ed +.Pp +Quietly save the +.Ql README.TXT file as +.Ql myreadme.txt +and do not delete the output file under any circumstances: +.Bd -literal -offset indent +fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed +.Pp +Print the size of the requested file and identify the request with a custom user +agent string: +.Bd -literal -offset indent +$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT +--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101" +3513231 +.Ed +.Pp +Restart the transfer of the +.Ql README.TXT +file and retry the transfer upon soft failures: +.Bd -literal -offset indent +$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT +.Ed .Sh SEE ALSO .Xr fetch 3 , .Xr phttpget 8 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367142 - head/usr.bin/fmt
Author: fernape (ports committer) Date: Thu Oct 29 18:37:20 2020 New Revision: 367142 URL: https://svnweb.freebsd.org/changeset/base/367142 Log: fmt(1): Add EXAMPLES section Very small EXAMPLES section. While here, remove reference to nroff(1). Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26947 Modified: head/usr.bin/fmt/fmt.1 Modified: head/usr.bin/fmt/fmt.1 == --- head/usr.bin/fmt/fmt.1 Thu Oct 29 18:34:47 2020(r367141) +++ head/usr.bin/fmt/fmt.1 Thu Oct 29 18:37:20 2020(r367142) @@ -30,7 +30,7 @@ .\" .\" Modified by Gareth McCaughan to describe the new version of `fmt' .\" rather than the old one. -.Dd December 1, 2017 +.Dd October 29, 2020 .Dt FMT 1 .Os .Sh NAME @@ -89,10 +89,6 @@ Try to format mail header lines contained in the input Format lines beginning with a .Ql \&. (dot) character. -Normally, -.Nm -does not fill these lines, for compatibility with -.Xr nroff 1 . .It Fl p Allow indented paragraphs. Without the @@ -159,10 +155,23 @@ environment variables affect the execution of .Nm as described in .Xr environ 7 . +.Sh EXAMPLES +Center the text in standard input: +.Bd -literal -offset indent +$ echo -e 'The merit of all things\enlies\enin their difficulty' | fmt -c + The merit of all things + lies + in their difficulty +.Ed +.Pp +Format the text in standard input collapsing spaces: +.Bd -literal -offset indent +$ echo -e 'Multiple spaceswill be collapsed' | fmt -s +Multiple spaces will be collapsed +.Ed .Sh SEE ALSO .Xr fold 1 , -.Xr mail 1 , -.Xr nroff 1 +.Xr mail 1 .Sh HISTORY The .Nm ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367143 - head/usr.bin/fold
Author: fernape (ports committer) Date: Thu Oct 29 18:39:04 2020 New Revision: 367143 URL: https://svnweb.freebsd.org/changeset/base/367143 Log: fold(1): Add EXAMPLES section A couple of examples covering -s and -w flags. Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26948 Modified: head/usr.bin/fold/fold.1 Modified: head/usr.bin/fold/fold.1 == --- head/usr.bin/fold/fold.1Thu Oct 29 18:37:20 2020(r367142) +++ head/usr.bin/fold/fold.1Thu Oct 29 18:39:04 2020(r367143) @@ -28,7 +28,7 @@ .\"@(#)fold.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 2015 +.Dd October 29, 2020 .Dt FOLD 1 .Os .Sh NAME @@ -76,6 +76,22 @@ environment variables affect the execution of .Nm as described in .Xr environ 7 . +.Sh EXAMPLES +Fold text in standard input with a width of 20 columns: +.Bd -literal -offset indent +$ echo "I am smart enough to know that I am dumb" | fold -w 15 +I am smart enou +gh to know that + I am dumb +.Ed +.Pp +Same as above but breaking lines after the last blank character: +.Bd -literal -offset indent +$ echo "I am smart enough to know that I am dumb" | fold -s -w 15 +I am smart +enough to know +that I am dumb +.Ed .Sh SEE ALSO .Xr expand 1 , .Xr fmt 1 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r367142 - head/usr.bin/fmt
On Thu, Oct 29, 2020 at 7:47 PM wrote: > Fernando Apesteguía wrote: > > Author: fernape (ports committer) > > Date: Thu Oct 29 18:37:20 2020 > > New Revision: 367142 > > URL: https://svnweb.freebsd.org/changeset/base/367142 > > > > Log: > >fmt(1): Add EXAMPLES section > > > >Very small EXAMPLES section. > > > >While here, remove reference to nroff(1). > > > >Approved by: manpages (bcr@) > >Differential Revision: https://reviews.freebsd.org/D26947 > > > > Modified: > >head/usr.bin/fmt/fmt.1 > > > > Modified: head/usr.bin/fmt/fmt.1 > > > == > > --- head/usr.bin/fmt/fmt.1Thu Oct 29 18:34:47 2020(r367141) > > +++ head/usr.bin/fmt/fmt.1Thu Oct 29 18:37:20 2020(r367142) > > @@ -30,7 +30,7 @@ > > .\" > > .\" Modified by Gareth McCaughan to describe the new version of `fmt' > > .\" rather than the old one. > > -.Dd December 1, 2017 > > +.Dd October 29, 2020 > > .Dt FMT 1 > > .Os > > .Sh NAME > > @@ -89,10 +89,6 @@ Try to format mail header lines contained in the input > > Format lines beginning with a > > .Ql \&. > > (dot) character. > > -Normally, > > -.Nm > > -does not fill these lines, for compatibility with > > -.Xr nroff 1 . > > Was the behavior of fmt(1) really changed? If not, you could just > replace ".Xr nroff 1 ." with ".Nm nroff . ". > Hi, Thanks for reviewing the commit! In another revision I did something similar ( https://reviews.freebsd.org/D26146) (commit r366516) removing a BUGS section with details about nroff since it is not in base anymore. I got the impression that we should not refer to things that might (or might not) be installed from ports (see bcr@ comment in that review). I am not a docs committer and I don't know the policy here beyond those comments. But nevertheless if the paragraph has to be restored without cross reference, I'll do it :-) > > > .It Fl p > > Allow indented paragraphs. > > Without the > > @@ -159,10 +155,23 @@ environment variables affect the execution of > > .Nm > > as described in > > .Xr environ 7 . > > +.Sh EXAMPLES > > +Center the text in standard input: > > +.Bd -literal -offset indent > > +$ echo -e 'The merit of all things\enlies\enin their difficulty' | fmt > -c > > + The merit of all things > > + lies > > + in their difficulty > > +.Ed > > +.Pp > > +Format the text in standard input collapsing spaces: > > +.Bd -literal -offset indent > > +$ echo -e 'Multiple spaceswill be collapsed' | fmt -s > > +Multiple spaces will be collapsed > > +.Ed > > .Sh SEE ALSO > > .Xr fold 1 , > > -.Xr mail 1 , > > -.Xr nroff 1 > > +.Xr mail 1 > > .Sh HISTORY > > The > > .Nm > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367160 - head/usr.bin/fetch
Author: fernape (ports committer) Date: Fri Oct 30 09:48:41 2020 New Revision: 367160 URL: https://svnweb.freebsd.org/changeset/base/367160 Log: fetch(1): Fix style Fix style problems introduced in r367141: * s/Ql/Pa/ for file names * Break line properly in macro * Properly generate back slash character Not bumping .Dd Reported by: xto...@icloud.com, stef...@sdaoden.eu Approved by: 0mp@ Differential Revision:https://reviews.freebsd.org/D26946 Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 == --- head/usr.bin/fetch/fetch.1 Fri Oct 30 09:40:55 2020(r367159) +++ head/usr.bin/fetch/fetch.1 Fri Oct 30 09:48:41 2020(r367160) @@ -389,14 +389,14 @@ Silently try to fetch the URLs passed as parameters. The first one will fail. If the second URL succeeds the third one will not be tried: .Bd -literal -offset indent -$ fetch -1 -q https://www.freebsd.org/bad.html \\ - ftp.freebsd.org/pub/FreeBSD/README.TXT \\ +$ fetch -1 -q https://www.freebsd.org/bad.html \e + ftp.freebsd.org/pub/FreeBSD/README.TXT \e https://www.fake.url fetch: https://www.freebsd.org/bad.html: Not Found .Ed .Pp Be verbose when retrieving the -.Ql README.TXT +.Pa README.TXT file: .Bd -literal -offset indent $ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT @@ -408,8 +408,9 @@ README.TXT .Ed .Pp Quietly save the -.Ql README.TXT file as -.Ql myreadme.txt +.Pa README.TXT +file as +.Pa myreadme.txt and do not delete the output file under any circumstances: .Bd -literal -offset indent fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT @@ -424,7 +425,7 @@ $ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT .Ed .Pp Restart the transfer of the -.Ql README.TXT +.Pa README.TXT file and retry the transfer upon soft failures: .Bd -literal -offset indent $ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r367141 - head/usr.bin/fetch
On Thu, Oct 29, 2020 at 7:52 PM wrote: > Fernando Apesteguía wrote: > > Author: fernape (ports committer) > > Date: Thu Oct 29 18:34:47 2020 > > New Revision: 367141 > > URL: https://svnweb.freebsd.org/changeset/base/367141 > > > > Log: > >fetch(1): Add EXAMPLES section > > > >Add a few examples covering flags: 1, R, a, o, q, r, s, v > > > >Approved by: manpages (bcr@) > >Differential Revision: https://reviews.freebsd.org/D26946 > > > > Modified: > >head/usr.bin/fetch/fetch.1 > > > > Modified: head/usr.bin/fetch/fetch.1 > > > == > > --- head/usr.bin/fetch/fetch.1Thu Oct 29 18:29:22 2020 > (r367140) > > +++ head/usr.bin/fetch/fetch.1Thu Oct 29 18:34:47 2020 > (r367141) > > @@ -30,7 +30,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd May 6, 2018 > > +.Dd October 29, 2020 > > .Dt FETCH 1 > > .Os > > .Sh NAME > > @@ -384,6 +384,51 @@ If the > > argument is used and the remote file is not newer than the > > specified file then the command will still return success, > > although no file is transferred. > > +.Sh EXAMPLES > > +Silently try to fetch the URLs passed as parameters. > > +The first one will fail. > > +If the second URL succeeds the third one will not be tried: > > +.Bd -literal -offset indent > > +$ fetch -1 -q https://www.freebsd.org/bad.html \\ > > + ftp.freebsd.org/pub/FreeBSD/README.TXT \\ > > + https://www.fake.url > > +fetch: https://www.freebsd.org/bad.html: Not Found > > +.Ed > > +.Pp > > +Be verbose when retrieving the > > +.Ql README.TXT > > +file: > > +.Bd -literal -offset indent > > +$ fetch -v ftp.freebsd.org/pub/FreeBSD/README.TXT > > +resolving server address: ftp.freebsd.org:80 > > +requesting http://ftp.freebsd.org/pub/FreeBSD/README.TXT > > +local size / mtime: 4259 / 1431015519 > > +remote size / mtime: 4259 / 1431015519 > > +README.TXT4259 B 44 > MBps00s > > +.Ed > > +.Pp > > +Quietly save the > > +.Ql README.TXT file as > > "file as" should be on separate line, otherwise it's treated as part of > .Ql argument. BTW, why are we not using .Pa for these? > Thanks for catching this. It should be fixed by now. Cheers. > > > +.Ql myreadme.txt > > +and do not delete the output file under any circumstances: > > +.Bd -literal -offset indent > > +fetch -o myreadme.txt -q -R ftp.freebsd.org/pub/FreeBSD/README.TXT > > +.Ed > > +.Pp > > +Print the size of the requested file and identify the request with a > custom user > > +agent string: > > +.Bd -literal -offset indent > > +$ fetch -s ftp.freebsd.org/pub/FreeBSD/README.TXT > > +--user-agent="Mozilla/5.0 (X11; FreeBSD x86_64; rv:78.0) Gecko/20100101" > > +3513231 > > +.Ed > > +.Pp > > +Restart the transfer of the > > +.Ql README.TXT > > +file and retry the transfer upon soft failures: > > +.Bd -literal -offset indent > > +$ fetch -a -r http://ftp.freebsd.org/pub/FreeBSD/README.TXT > > +.Ed > > .Sh SEE ALSO > > .Xr fetch 3 , > > .Xr phttpget 8 > > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r367141 - head/usr.bin/fetch
On Thu, Oct 29, 2020 at 8:03 PM Steffen Nurpmeso wrote: > Hey. > > Fernando Apesteguía wrote in > <202010291834.09tiylrb040...@repo.freebsd.org>: > |Author: fernape (ports committer) > |Date: Thu Oct 29 18:34:47 2020 > |New Revision: 367141 > |URL: https://svnweb.freebsd.org/changeset/base/367141 > | > |Log: > | fetch(1): Add EXAMPLES section > | > | Add a few examples covering flags: 1, R, a, o, q, r, s, v > | > | Approved by:manpages (bcr@) > | Differential Revision: https://reviews.freebsd.org/D26946 > | > |Modified: > | head/usr.bin/fetch/fetch.1 > ... > |+$ fetch -1 -q https://www.freebsd.org/bad.html \\ > |+ ftp.freebsd.org/pub/FreeBSD/README.TXT \\ > > groff(7) says > >\\ reduces to a single backslash; useful to delay its interpreta‐ > tion as escape character in copy mode. For a printable back‐ > slash, use \e, or even better \[rs], to be independent from the > current escape character. > Thanks Steffen, Should be fixed by now. Cheers. > > --steffen > | > |Der Kragenbaer,The moon bear, > |der holt sich munter he cheerfully and one by one > |einen nach dem anderen runter wa.ks himself off > |(By Robert Gernhardt) > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367850 - head/usr.bin/grep
Author: fernape (ports committer) Date: Thu Nov 19 18:58:15 2020 New Revision: 367850 URL: https://svnweb.freebsd.org/changeset/base/367850 Log: grep(1): Add more EXAMPLES * Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w * While here, change existing wording to use the imperative (remove "To find") * Reword first example to be consistent with how grep(1) understand words (-w) Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D27264 Modified: head/usr.bin/grep/grep.1 Modified: head/usr.bin/grep/grep.1 == --- head/usr.bin/grep/grep.1Thu Nov 19 18:37:28 2020(r367849) +++ head/usr.bin/grep/grep.1Thu Nov 19 18:58:15 2020(r367850) @@ -30,7 +30,7 @@ .\" .\"@(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd August 7, 2020 +.Dd November 19, 2020 .Dt GREP 1 .Os .Sh NAME @@ -456,13 +456,27 @@ An error occurred. .Sh EXAMPLES .Bl -dash .It -To find all occurrences of the word +Find all occurrences of the pattern .Sq patricia in a file: .Pp .Dl $ grep 'patricia' myfile .It -To find all occurrences of the pattern +Same as above but looking only for complete words: +.Pp +.Dl $ grep -w 'patricia' myfile +.It +Count occurrences of the exact pattern +.Sq FOO +: +.Pp +.Dl $ grep -c FOO myfile +.It +Same as above but ignoring case: +.Pp +.Dl $ grep -c -i FOO myfile +.It +Find all occurrences of the pattern .Ql .Pp at the beginning of a line: .Pp @@ -480,20 +494,55 @@ escapes the .Ql \&. , which would otherwise match any character. .It -To find all lines in a file which do not contain the words +Find all lines in a file which do not contain the words .Sq foo or .Sq bar : .Pp .Dl $ grep -v -e 'foo' -e 'bar' myfile .It -A simple example of an extended regular expression: +Peruse the file +.Sq calendar +looking for either 19, 20, or 25 using extended regular expressions: .Pp .Dl $ egrep '19|20|25' calendar +.It +Show matching lines and the name of the +.Sq *.h +files which contain the pattern +.Sq FIXME . +Do the search recursively from the +.Pa /usr/src/sys/arm +directory .Pp -Peruses the file -.Sq calendar -looking for either 19, 20, or 25. +.Dl $ grep -H -R FIXME --include=*.h /usr/src/sys/arm/ +.It +Same as above but show only the name of the matching file: +.Pp +.Dl $ grep -l -R FIXME --include=*.h /usr/src/sys/arm/ +.It +Show lines containing the text +.Sq foo . +The matching part of the output is colored and every line is prefixed with +the line number and the offset in the file for those lines that matched. +.Pp +.Dl $ grep -b --colour -n foo myfile +.It +Show lines that match the extended regular expression patterns read from the +standard input: +.Pp +.Dl $ echo -e 'Free\enBSD\enAll.*reserved' | grep -E -f - myfile +.It +Show lines from the output of the +.Xr pciconf 8 +command matching the specified extended regular expression along with +three lines of leading context and one line of trailing context: +.Pp +.Dl $ pciconf -lv | grep -B3 -A1 -E 'class.*=.*storage' +.It +Suppress any output and use the exit status to show an appropriate message: +.Pp +.Dl $ grep -q foo myfile && echo File matches .El .Sh SEE ALSO .Xr ed 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r367851 - head/usr.bin/fstat
Author: fernape (ports committer) Date: Thu Nov 19 19:05:16 2020 New Revision: 367851 URL: https://svnweb.freebsd.org/changeset/base/367851 Log: fstat(1): Add EXAMPLES section * Add examples covering -f, -m and -p flags. While here, extend the initial description paragraph to note that fstat(1) will report on all opened files, belonging to processes the user has access to. The current paragraph may lead to understand that you can get information on opened files from processes belonging to other users. Reviewed by: bjk@, danfe@, gbe@ Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26949 Modified: head/usr.bin/fstat/fstat.1 Modified: head/usr.bin/fstat/fstat.1 == --- head/usr.bin/fstat/fstat.1 Thu Nov 19 18:58:15 2020(r367850) +++ head/usr.bin/fstat/fstat.1 Thu Nov 19 19:05:16 2020(r367851) @@ -28,7 +28,7 @@ .\" @(#)fstat.18.3 (Berkeley) 2/25/94 .\" $FreeBSD$ .\" -.Dd June 17, 2020 +.Dd November 19, 2020 .Dt FSTAT 1 .Os .Sh NAME @@ -51,7 +51,7 @@ is the working directory, root directory, jail root di active executable text, or kernel trace file for that process. If no options are specified, .Nm -reports on all open files in the system. +reports on all open files in the system for processes the user has access to. .Pp The following options are available: .Bl -tag -width "-N system" @@ -118,7 +118,7 @@ The process id. The file number in the per-process open file table or one of the following special names: .Pp -.Bl -tag -offset indent -compact +.Bl -tag -width jail -offset indent -compact .It Sy jail jail root directory .It Sy mmap @@ -235,6 +235,93 @@ a double arrow .Pq Ql <-> . For UNIX/local sockets either the local or remote address is shown, depending on which one is available. +.Sh EXIT STATUS +.Ex -std +.Sh EXAMPLES +Show all open files except those opened by +.Nm +itself: +.Bd -literal -offset indent +$ fstat | awk '$2 != "fstat"' +USER CMD PID FD MOUNT INUM MODE SZ|DV R/W +alice bash 469 text /usr/local 143355 -rwxr-xr-x 1166448 r +alice bash 469 ctty /dev346 crw--w pts/81 rw +\&... +.Ed +.Pp +Report all files opened by the current shell in the same file system as +.Pa /usr/local +including memory-mapped files: +.Bd -literal -offset indent +$ fstat -m -p $$ -f /usr/local +USER CMD PID FD MOUNT INUM MODE SZ|DV R/W +bob bash 469 text /usr/local 143355 -rwxr-xr-x 1166448 r +bob bash 469 mmap /usr/local 143355 -rwxr-xr-x 1166448 r +\&... +.Ed +.Pp +Requesting information about a file that is not opened results in just a +header line instead of an error: +.Bd -literal -offset indent +$ fstat /etc/rc.conf +USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME +.Ed +.Pp +All parameters after +.Fl f +will be interpreted as files, so the following will not work as expected: +.Bd -literal -offset indent +$ fstat -f /usr/local -m -p $$ +fstat: -m: No such file or directory +fstat: -p: No such file or directory +fstat: 469: No such file or directory +\&... +.Ed +.Pp +Show number of pipes opened by firefox processes: +.Bd -literal -offset indent +$ fstat | awk '$2=="firefox" && $5=="pipe"' | wc -l +.Ed +.Pp +Show processes belonging to user +.Dq bob +whose standard error descriptor is opened in ttyv0: +.Bd -literal -offset indent +$ fstat -u bob | awk '$4 == 2 && $8 == "ttyv0"' +bob firefox778422 /dev103 crw--- ttyv0 rw +bob xinit 11942 /dev103 crw--- ttyv0 rw +\&... +.Ed +.Pp +Show opened TCP sockets. +This output resembles the one produced by +.Ql netstat -A -p tcp +: +.Bd -literal -offset indent +$ fstat | awk '$7 == "tcp"' +alice firefox77991 32* internet stream tcp f800b7f147a0 +alice firefox77991 137* internet stream tcp f800b7f12b70 +\&... +.Ed +.Pp +Show a list of processes with files opened in the current directory +mimicking the output of +.Xr fuser 1 +: +.Bd -literal -offset indent +$ fstat . | awk 'NR > 1 {printf "%d%s(%s) ", $3, $4, $1;}' +2133wd(alice) 2132wd(alice) 1991wd(alice) +.Ed +.Pp +Create a list of processes sorted by number of opened files in desdencing order: +.Bd -literal -offset indent +$ fstat | awk 'NR > 1 {print $2;}' | sort | uniq -c | sort -r + 728 firefox + 23 bash + 14 sort + 8 fstat + 7 awk +.Ed .Sh SEE ALSO .Xr fuser 1 , .Xr netstat 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r368160 - head/usr.bin/iconv
Author: fernape (ports committer) Date: Sun Nov 29 18:22:14 2020 New Revision: 368160 URL: https://svnweb.freebsd.org/changeset/base/368160 Log: iconv(1): Add EXAMPLE Just a small example to show simple usage. Approved by: manpages (0mp@) MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D27385 Modified: head/usr.bin/iconv/iconv.1 Modified: head/usr.bin/iconv/iconv.1 == --- head/usr.bin/iconv/iconv.1 Sun Nov 29 17:42:32 2020(r368159) +++ head/usr.bin/iconv/iconv.1 Sun Nov 29 18:22:14 2020(r368160) @@ -104,6 +104,13 @@ Specifies the destination codeset name as .El .Sh EXIT STATUS .Ex -std iconv +.Sh EXAMPLES +Convert +.Pa file.txt +from IBM273 to UTF-8 and save the result to +.Pa converted.txt : +.Pp +.Dl iconv -f IBM273 -t UTF-8 file.txt > converted.txt .Sh SEE ALSO .Xr mkcsmapper 1 , .Xr mkesdb 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r368518 - head/usr.bin/id
Author: fernape (ports committer) Date: Thu Dec 10 17:48:34 2020 New Revision: 368518 URL: https://svnweb.freebsd.org/changeset/base/368518 Log: groups(1): Add EXAMPLE Add a super simple example Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D27538 Modified: head/usr.bin/id/groups.1 Modified: head/usr.bin/id/groups.1 == --- head/usr.bin/id/groups.1Thu Dec 10 17:48:30 2020(r368517) +++ head/usr.bin/id/groups.1Thu Dec 10 17:48:34 2020(r368518) @@ -55,5 +55,11 @@ utility displays the groups to which you (or the optio belong. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show groups the root user belongs to: +.Bd -literal -offset indent +$ groups root +wheel operator +.Ed .Sh SEE ALSO .Xr id 1 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r368520 - head/usr.bin/id
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.1Thu Dec 10 18:07:25 2020(r368519) +++ head/usr.bin/id/id.1Thu 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/5Dec 4 19:51 +.Ed .Sh SEE ALSO +.Xr groups 1 , .Xr who 1 .Sh STANDARDS The ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r368556 - head/usr.bin/lock
Author: fernape (ports committer) Date: Fri Dec 11 19:27:21 2020 New Revision: 368556 URL: https://svnweb.freebsd.org/changeset/base/368556 Log: lock(1): Add EXAMPLES section Add simple example showing the use of the flags: p, t, v Reviewed by: gbe@, yuripv@ Approved by: manpages (yuripv@) Differential Revision:https://reviews.freebsd.org/D27541 Modified: head/usr.bin/lock/lock.1 Modified: head/usr.bin/lock/lock.1 == --- head/usr.bin/lock/lock.1Fri Dec 11 18:14:43 2020(r368555) +++ head/usr.bin/lock/lock.1Fri Dec 11 19:27:21 2020(r368556) @@ -28,7 +28,7 @@ .\"@(#)lock.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 10, 2002 +.Dd December 11, 2020 .Dt LOCK 1 .Os .Sh NAME @@ -73,6 +73,11 @@ or .Xr vt 4 virtual terminal. .El +.Sh EXAMPLES +Lock the terminal for 5 minutes, disable switching virtual terminals and +require the user's login password to unlock: +.Pp +.Dl $ lock -p -t 5 -v .Sh SEE ALSO .Xr vidcontrol 1 , .Xr syscons 4 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362060 - head/usr.bin/xargs
Author: fernape (ports committer) Date: Thu Jun 11 15:14:39 2020 New Revision: 362060 URL: https://svnweb.freebsd.org/changeset/base/362060 Log: xargs(1): Add EXAMPLES to man page Add EXAMPLES covering options I, J, L, n, P. While here, fix warning (STYLE: no blank before trailing delimiter: Fl P,) Bumping .Dd Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D25214 Modified: head/usr.bin/xargs/xargs.1 Modified: head/usr.bin/xargs/xargs.1 == --- head/usr.bin/xargs/xargs.1 Thu Jun 11 14:57:30 2020(r362059) +++ head/usr.bin/xargs/xargs.1 Thu Jun 11 15:14:39 2020(r362060) @@ -33,7 +33,7 @@ .\" $FreeBSD$ .\" $xMach: xargs.1,v 1.2 2002/02/23 05:23:37 tim Exp $ .\" -.Dd August 4, 2015 +.Dd June 11, 2020 .Dt XARGS 1 .Os .Sh NAME @@ -325,6 +325,32 @@ exits with a value of 126. If any other error occurs, .Nm exits with a value of 1. +.Sh EXAMPLES +Create a 3x3 matrix with numbers from 1 to 9. +Every +.Xr echo 1 +instance receives three lines as arguments: +.Bd -literal -offset indent +$ seq 1 9 | xargs -L3 echo +1 2 3 +4 5 6 +7 8 9 +.Ed +.Pp +Duplicate every line from standard input: +.Bd -literal -offset indent +$ echo -e "one\\ntwo\\nthree" | xargs -I % echo % % +one one +two two +three three +.Ed +.Pp +Execute at most 2 concurrent instances of +.Xr find 1 +every one of them using one of the directories from the standard input: +.Bd -literal -offset indent +echo -e "/usr/ports\\n/etc\\n/usr/local" | xargs -J % -P2 -n1 find % -name file +.Ed .Sh SEE ALSO .Xr echo 1 , .Xr find 1 , @@ -336,7 +362,7 @@ utility is expected to be .St -p1003.2 compliant. The -.Fl J , o , P, R +.Fl J , o , P , R and .Fl S options are non-standard ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362149 - head/usr.bin/sockstat
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.1Sat Jun 13 14:11:02 2020 (r362148) +++ head/usr.bin/sockstat/sockstat.1Sat 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 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362191 - head/sbin/md5
Author: fernape (ports committer) Date: Mon Jun 15 10:08:02 2020 New Revision: 362191 URL: https://svnweb.freebsd.org/changeset/base/362191 Log: md5(1): fix style in man page Fix a bunch of style problems reported by mandoc(1) and igor: mandoc: ./md5.1:19:71: STYLE: no blank before trailing delimiter: Nm ... rmd160, mandoc: ./md5.1:20:23: STYLE: no blank before trailing delimiter: Nm ... skein512, mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:33:2: STYLE: useless macro: Tn mandoc: ./md5.1:35:2: STYLE: useless macro: Tn mandoc: ./md5.1:42:2: STYLE: useless macro: Tn mandoc: ./md5.1:45:2: STYLE: useless macro: Tn mandoc: ./md5.1:47:2: STYLE: useless macro: Tn mandoc: ./md5.1:56:2: STYLE: useless macro: Tn mandoc: ./md5.1:58:2: STYLE: useless macro: Tn mandoc: ./md5.1:61:2: STYLE: useless macro: Tn mandoc: ./md5.1:66:2: STYLE: useless macro: Tn mandoc: ./md5.1:68:2: STYLE: useless macro: Tn mandoc: ./md5.1:104:24: STYLE: no blank before trailing delimiter: Nm skein512, mandoc: ./md5.1:117:6: STYLE: referenced manual not found: Xr sha224 3 igor: md5.1:46:no comma after "i.e.":either algorithm, [i.e.] to find an input that produces a specific Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25277 Modified: head/sbin/md5/md5.1 Modified: head/sbin/md5/md5.1 == --- head/sbin/md5/md5.1 Mon Jun 15 03:10:53 2020(r362190) +++ head/sbin/md5/md5.1 Mon Jun 15 10:08:02 2020(r362191) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 9, 2018 +.Dd June 15, 2020 .Dt MD5 1 .Os .Sh NAME @@ -16,8 +16,8 @@ (All other hashes have the same options and usage.) .Sh DESCRIPTION The -.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512, sha512t256, rmd160, -.Nm skein256, skein512, +.Nm md5 , sha1 , sha224 , sha256 , sha384 , sha512 , sha512t256 , rmd160 , +.Nm skein256 , skein512 , and .Nm skein1024 utilities take as input a message of arbitrary length and produce as @@ -29,43 +29,29 @@ of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest. -The -.Tn SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, -and -.Tn SKEIN +The SHA-224 , SHA-256 , SHA-384 , SHA-512, RIPEMD-160, +and SKEIN algorithms are intended for digital signature applications, where a large file must be .Dq compressed in a secure manner before being encrypted with a private (secret) -key under a public-key cryptosystem such as -.Tn RSA . +key under a public-key cryptosystem such as RSA. .Pp -The -.Tn MD5 -and -.Tn SHA-1 -algorithms have been proven to be vulnerable to practical collision -attacks and should not be relied upon to produce unique outputs, +The MD5 and SHA-1 algorithms have been proven to be vulnerable to practical +collision attacks and should not be relied upon to produce unique outputs, .Em nor should they be used as part of a cryptographic signature scheme. As of 2017-03-02, there is no publicly known method to .Em reverse -either algorithm, i.e. to find an input that produces a specific +either algorithm, i.e., to find an input that produces a specific output. .Pp -.Tn SHA-512t256 -is a version of -.Tn SHA-512 -truncated to only 256 bits. -On 64-bit hardware, this algorithm is approximately 50% faster than -.Tn SHA-256 -but with the same level of security. +SHA-512t256 is a version of SHA-512 truncated to only 256 bits. +On 64-bit hardware, this algorithm is approximately 50% faster than SHA-256 but +with the same level of security. The hashes are not interchangeable. .Pp -It is recommended that all new applications use -.Tn SHA-512 -or -.Tn SKEIN-512 +It is recommended that all new applications use SHA-512 or SKEIN-512 instead of one of the other hash functions. .Pp The following options may be used in any combination and must @@ -101,7 +87,7 @@ Run a built-in test script. .Sh EXIT STATUS The .Nm md5 , sha1 , sha224 , sha256 , sha512 , sha512t256 , rmd160 , -.Nm skein256 , skein512, +.Nm skein256 , skein512 , and .Nm skein1024 utilities exit 0 on success, @@ -114,7 +100,6 @@ option. .Xr md5 3 , .Xr ripemd 3 , .Xr sha 3 , -.Xr sha224 3 , .Xr sha256 3 , .Xr sha384 3 , .Xr sha512 3 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362229 - head/usr.bin/cmp
Author: fernape (ports committer) Date: Tue Jun 16 15:54:59 2020 New Revision: 362229 URL: https://svnweb.freebsd.org/changeset/base/362229 Log: cmp(1): Add EXAMPLES section Add simple examples showing the use of -l, -z, stdin and offsets Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D25280 Modified: head/usr.bin/cmp/cmp.1 Modified: head/usr.bin/cmp/cmp.1 == --- head/usr.bin/cmp/cmp.1 Tue Jun 16 14:02:51 2020(r362228) +++ head/usr.bin/cmp/cmp.1 Tue Jun 16 15:54:59 2020(r362229) @@ -31,7 +31,7 @@ .\" @(#)cmp.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 1, 2018 +.Dd June 16, 2020 .Dt CMP 1 .Os .Sh NAME @@ -106,6 +106,40 @@ file (before any differences were found). .It >1 An error occurred. .El +.Sh EXAMPLES +Assuming a file named example.txt with the following contents: +.Bd -literal -offset indent +a +b +c +.Ed +.Pp +Compare stdin with example.txt: +.Bd -literal -offset indent +$ echo -e "a\\nb\\nc" | cmp - example.txt +.Ed +.Pp +Same as above but introducing a change in byte three in stdin. +Show the byte number (decimal) and differing byte (octal): +.Bd -literal -offset indent +$ echo -e "a\\nR\\nc" | cmp -l - example.txt + 3 122 142 +.Ed +.Pp +Compare example.txt and /boot/loader.conf exiting if size differs. +Note that +.Fl z +can only be used with regular files: +.Bd -literal -offset indent +$ cmp -z example.txt /boot/loader.conf +example.txt /boot/loader.conf differ: size +.Ed +.Pp +Compare stdin with file example.txt omitting the 4 first bytes from stdin and +the 2 first bytes from example.txt: +.Bd -literal -offset indent +$ echo -e "a\\nR\\nb\\nc" | cmp - example.txt 4 2 +.Ed .Sh SEE ALSO .Xr diff 1 , .Xr diff3 1 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r330765 - head/share/misc
Author: fernape (ports committer) Date: Sun Mar 11 10:47:40 2018 New Revision: 330765 URL: https://svnweb.freebsd.org/changeset/base/330765 Log: Add myself (fernape) to commiters-port.dot Approved by: tcberner (mentor) Differential Revision:https://reviews.freebsd.org/D14639 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotSun Mar 11 08:27:11 2018 (r330764) +++ head/share/misc/committers-ports.dotSun Mar 11 10:47:40 2018 (r330765) @@ -103,6 +103,7 @@ erwin [label="Erwin Lansing\ner...@freebsd.org\n2003/0 eugen [label="Eugene Grosbein\neu...@freebsd.org\n2017/03/04"] farrokhi [label="Babak Farrokhi\nfarro...@freebsd.org\n2006/11/07"] feld [label="Mark Felder\nf...@freebsd.org\n2013/06/25"] +fernape [label="Fernando Apesteguia\nfern...@freebsd.org\n2018/03/03"] fjoe [label="Max Khon\nf...@freebsd.org\n2001/08/06"] flo [label="Florian Smeets\n...@freebsd.org\n2010/12/07"] fluffy [label="Dima Panov\nflu...@freebsd.org\n2009/08/10"] @@ -663,6 +664,7 @@ tabthorpe -> gblach tcberner -> adridg tcberner -> joneum tcberner -> yuri +tcberner -> fernape thierry -> jadawin thierry -> riggs @@ -671,6 +673,7 @@ tmclaugh -> itetcu tmclaugh -> xride tz -> joneum +tz -> fernape vsevolod -> eugen ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r330768 - head/usr.bin/calendar/calendars
Author: fernape (ports committer) Date: Sun Mar 11 17:21:48 2018 New Revision: 330768 URL: https://svnweb.freebsd.org/changeset/base/330768 Log: Add myself (fernape) to calendar.freebsd As indicated in Committers guide Chapter 6, point 9 "Optional: Update Ports with Personal Information" Approved by: tcberner Differential Revision:https://reviews.freebsd.org/D14653 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdSun Mar 11 16:57:14 2018(r330767) +++ head/usr.bin/calendar/calendars/calendar.freebsdSun Mar 11 17:21:48 2018(r330768) @@ -266,6 +266,7 @@ 07/10 David Schultz born in Oakland, California, United States, 1982 07/10 Ben Woods born in Perth, Western Australia, Australia, 1984 07/11 Jesus R. Camou born in Hermosillo, Sonora, Mexico, 1983 +07/14 Fernando Apesteguia born in Madrid, Spain, 1981 07/15 Gary Jennejohn born in Rochester, New York, United States, 1950 07/16 Suleiman Souhlal born in Roma, Italy, 1983 07/16 Davide Italiano born in Milazzo, Italy, 1989 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364976 - head/usr.bin/tsort
Author: fernape (ports committer) Date: Sun Aug 30 17:37:56 2020 New Revision: 364976 URL: https://svnweb.freebsd.org/changeset/base/364976 Log: tsort(1): Add EXAMPLES section Add a couple of simple examples to the man page Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D25883 Modified: head/usr.bin/tsort/tsort.1 Modified: head/usr.bin/tsort/tsort.1 == --- head/usr.bin/tsort/tsort.1 Sun Aug 30 17:13:04 2020(r364975) +++ head/usr.bin/tsort/tsort.1 Sun Aug 30 17:37:56 2020(r364976) @@ -31,7 +31,7 @@ .\" @(#)tsort.18.3 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd December 27, 2006 +.Dd August 30, 2020 .Dt TSORT 1 .Os .Sh NAME @@ -75,6 +75,71 @@ This is primarily intended for building libraries, where optimal ordering is not critical, and cycles occur often. .El +.Sh EXAMPLES +Assuming a file named +.Pa dag +with the following contents representing a directed acyclic graph: +.Bd -literal -offset indent +A B +A F +B C +B D +D E +.Ed +.Pp +Sort the nodes of the graph: +.Bd -literal -offset indent +$ tsort dag +A +F +B +D +C +E +.Ed +.Pp +White spaces and new line characters are considered equal. +This file for example is considered equal to the one we defined before: +.Bd -literal -offset indent +$ cat dga +A B A F B C B D D E +.Ed +.Pp +Assume we add a new directed arc from D to A creating a cycle: +.Bd -literal -offset indent +A B +A F +B C +B D +D E +D A +.Ed +.Pp +Ordering the graph detects the cycle: +.Bd -literal -offset indent +$ tsort dag +tsort: cycle in data +tsort: A +tsort: B +tsort: D +D +E +A +F +B +C +.Ed +.Pp +Same as above but silencing the warning about the cycle: +.Bd -literal -offset indent +$ tsort -q dag +D +E +A +F +B +C +.Ed .Sh SEE ALSO .Xr ar 1 .Sh HISTORY ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r364977 - head/usr.bin/who
Author: fernape (ports committer) Date: Sun Aug 30 17:40:59 2020 New Revision: 364977 URL: https://svnweb.freebsd.org/changeset/base/364977 Log: who(1): Add EXAMPLES section Add EXAMPLES section covering all the flags except -m and -bTu covered by other flags. Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26219 Modified: head/usr.bin/who/who.1 Modified: head/usr.bin/who/who.1 == --- head/usr.bin/who/who.1 Sun Aug 30 17:37:56 2020(r364976) +++ head/usr.bin/who/who.1 Sun Aug 30 17:40:59 2020(r364977) @@ -28,7 +28,7 @@ .\" @(#)who.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd February 11, 2012 +.Dd August 30, 2020 .Dt WHO 1 .Os .Sh NAME @@ -80,7 +80,7 @@ An error occurred. .El .It Fl u Show idle time for each user in hours and minutes as -.Ar hh Ns : Ns Ar mm , +.Ar hh : Ns Ar mm , .Ql \&. if the user has been idle less than a minute, and .Dq Li old @@ -140,6 +140,47 @@ as described in .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show a brief summary of who is logged in: +.Bd -literal -offset indent +$ who -q +fernape root root +# users = 3 +.Ed +.Pp +Show who is logged in along with the line and time fields (without the headers): +.Bd -literal -offset indent +$ who -s +fernape ttyv0Aug 26 16:23 +root ttyv1Aug 26 16:23 +root ttyv2Aug 26 16:23 +.Ed +.Pp +Show information about the terminal attached to standard input: +.Bd -literal -offset indent +$ who am i +fernape Aug 26 16:24 +.Ed +.Pp +Show time and date of the last system reboot, whether the users accept messages +and the idle time for each of them: +.Bd -literal -offset indent +$ who -a + - system boot Aug 26 16:23 . +fernape - ttyv0Aug 26 16:23 . +root - ttyv1Aug 26 16:23 . +root - ttyv2Aug 26 16:23 . +.Ed +.Pp +Same as above but showing headers: +.Bd -literal -offset indent +$ who -aH +NAME S LINE TIME IDLE FROM + - system boot Aug 26 16:23 . +fernape - ttyv0Aug 26 16:23 . +root - ttyv1Aug 26 16:23 00:01 +root - ttyv2Aug 26 16:23 00:01 +.Ed .Sh SEE ALSO .Xr last 1 , .Xr users 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r365266 - head/sbin/kldstat
Author: fernape (ports committer) Date: Wed Sep 2 18:15:57 2020 New Revision: 365266 URL: https://svnweb.freebsd.org/changeset/base/365266 Log: kldstat(8): Add EXAMPLES to the man page Add EXAMPLES for all the flags Approved by: manpages (bcr@) Differential Revision: https://reviews.freebsd.org/D26283 Modified: head/sbin/kldstat/kldstat.8 Modified: head/sbin/kldstat/kldstat.8 == --- head/sbin/kldstat/kldstat.8 Wed Sep 2 18:12:47 2020(r365265) +++ head/sbin/kldstat/kldstat.8 Wed Sep 2 18:15:57 2020(r365266) @@ -63,12 +63,84 @@ Display the status of only the file with this ID. .It Fl n Ar filename Display the status of only the file with this filename. .It Fl q -Only check if module is loaded or compiled into the kernel. +Only check if file is loaded or compiled into the kernel. .It Fl m Ar modname Display the status of only the module with this modname. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show files dynamically linked into the kernel. +Note the kernel itself is shown in the list. +.Em Refs +shows the number of modules referenced by each file: +.Bd -literal -offset indent +$ kldstat +Id Refs AddressSize Name + 1 38 0x8020 2448f20 kernel + 23 0x82649000b7bd8 linux.ko + 35 0x82701000 9698 linux_common.ko + 41 0x82b11000 1eae linsysfs.ko + 51 0x82b13000f2af8 nvidia-modeset.ko + 61 0x82c06000 122b020 nvidia.ko + 71 0x83e32000 2668 intpm.ko + 81 0x83e35000 b50 smbus.ko + 91 0x83e36000 18a0 uhid.ko +101 0x83e38000 2928 ums.ko +111 0x83e3b000 1aa0 wmt.ko +121 0x83e3d000 cd70 snd_uaudio.ko +.Ed +.Pp +Show the verbose status of the +.Em linux +file and show the size in a human readable fashion: +.Bd -literal -offset indent +$ kldstat -h -v -n linux +Id Refs Address Size Name + 23 0x82649000 735K linux.ko (/boot/kernel/linux.ko) +Contains modules: + Id Name + 2 linuxelf +.Ed +.Pp +Same as above using the +.Em id +of the file: +.Bd -literal -offset indent +$ kldstat -h -i 2 -v +Id Refs Address Size Name + 23 0x82649000 735K linux.ko (/boot/kernel/linux.ko) +Contains modules: + Id Name + 2 linuxelf +.Ed +.Pp +Show the status of the +.Em linuxelf +module obtained from the example above: +.Bd -literal -offset indent +$ kldstat -v -m linuxelf +Id Refs Name + 21 linuxelf +.Ed +.Pp +Show the module specific data for the +.Em g_raid +module: +.Bd -literal -offset indent +$ kldstat -d -m g_raid +Id Refs Name data..(int, uint, ulong) +3661 g_raid (0, 0, 0x0) +.Ed +.Pp +Check if the module +.Em fakefile +is linked. +Returns 0 if it is, 1 otherwise: +.Bd -literal -offset indent +$ kldstat -q -n fakefile || echo file not linked +file not linked +.Ed .Sh SEE ALSO .Xr kldstat 2 , .Xr kldload 8 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366119 - head/usr.bin/which
Author: fernape (ports committer) Date: Thu Sep 24 16:11:53 2020 New Revision: 366119 URL: https://svnweb.freebsd.org/changeset/base/366119 Log: which(1): Add EXAMPLES section to manpage Add EXAMPLES section showing the use of -a and -s flags and how which(1) treates duplicates. Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26182 Modified: head/usr.bin/which/which.1 Modified: head/usr.bin/which/which.1 == --- head/usr.bin/which/which.1 Thu Sep 24 15:38:01 2020(r366118) +++ head/usr.bin/which/which.1 Thu Sep 24 16:11:53 2020(r366119) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2006 +.Dd September 24, 2020 .Dt WHICH 1 .Os .Sh NAME @@ -62,6 +62,48 @@ command which is similar or identical to this utility. Consult the .Xr builtin 1 manual page. +.Sh EXAMPLES +Locate the +.Xr ls 1 +and +.Xr cp 1 +commands: +.Bd -literal -offset indent +$ /usr/bin/which ls cp +/bin/ls +/bin/cp +.Ed +.Pp +Same as above with a specific +.Va PATH +and showing all occurrences: +.Bd -literal -offset indent +$ PATH=/bin:/rescue /usr/bin/which -a ls cp +/bin/ls +/rescue/ls +/bin/cp +/rescue/cp +.Ed +.Pp +.Nm which +will show duplicates if the same executable is find more than once: +.Bd -literal -offset indent +$ PATH=/bin:/bin /usr/bin/which -a ls +/bin/ls +/bin/ls +.Ed +.Pp +Do not show output. +Just exit with an appropriate return code: +.Bd -literal -offset indent +$ /usr/bin/which -s ls cp +$ echo $? +0 + +$ /usr/bin/which -s fakecommand +$ echo $? +1 +.Ed .Sh SEE ALSO .Xr builtin 1 , .Xr csh 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366122 - head/usr.bin/which
Author: fernape (ports committer) Date: Thu Sep 24 16:42:17 2020 New Revision: 366122 URL: https://svnweb.freebsd.org/changeset/base/366122 Log: Fix typo and environment variable macro Follow up for r366119 Reported by: xto...@mm.st Differential Revision:https://reviews.freebsd.org/D26182 Modified: head/usr.bin/which/which.1 Modified: head/usr.bin/which/which.1 == --- head/usr.bin/which/which.1 Thu Sep 24 16:27:53 2020(r366121) +++ head/usr.bin/which/which.1 Thu Sep 24 16:42:17 2020(r366122) @@ -75,7 +75,7 @@ $ /usr/bin/which ls cp .Ed .Pp Same as above with a specific -.Va PATH +.Ev PATH and showing all occurrences: .Bd -literal -offset indent $ PATH=/bin:/rescue /usr/bin/which -a ls cp @@ -86,7 +86,7 @@ $ PATH=/bin:/rescue /usr/bin/which -a ls cp .Ed .Pp .Nm which -will show duplicates if the same executable is find more than once: +will show duplicates if the same executable is found more than once: .Bd -literal -offset indent $ PATH=/bin:/bin /usr/bin/which -a ls /bin/ls ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r366119 - head/usr.bin/which
On Thu, Sep 24, 2020 at 6:32 PM wrote: > > Fernando Apesteguía wrote: > > Author: fernape (ports committer) > > Date: Thu Sep 24 16:11:53 2020 > > New Revision: 366119 > > URL: https://svnweb.freebsd.org/changeset/base/366119 > > > > Log: > >which(1): Add EXAMPLES section to manpage > > > >Add EXAMPLES section showing the use of -a and -s flags and how which(1) > >treates duplicates. > > > >Approved by: manpages (gbe@) > >Differential Revision: https://reviews.freebsd.org/D26182 > > > > Modified: > >head/usr.bin/which/which.1 > > > > Modified: head/usr.bin/which/which.1 > > == > > --- head/usr.bin/which/which.1Thu Sep 24 15:38:01 2020 > > (r366118) > > +++ head/usr.bin/which/which.1Thu Sep 24 16:11:53 2020 > > (r366119) > > @@ -29,7 +29,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd December 13, 2006 > > +.Dd September 24, 2020 > > .Dt WHICH 1 > > .Os > > .Sh NAME > > @@ -62,6 +62,48 @@ command which is similar or identical to this utility. > > Consult the > > .Xr builtin 1 > > manual page. > > +.Sh EXAMPLES > > +Locate the > > +.Xr ls 1 > > +and > > +.Xr cp 1 > > +commands: > > +.Bd -literal -offset indent > > +$ /usr/bin/which ls cp > > +/bin/ls > > +/bin/cp > > +.Ed > > +.Pp > > +Same as above with a specific > > +.Va PATH > > .Ev ? > > > +and showing all occurrences: > > +.Bd -literal -offset indent > > +$ PATH=/bin:/rescue /usr/bin/which -a ls cp > > +/bin/ls > > +/rescue/ls > > +/bin/cp > > +/rescue/cp > > +.Ed > > +.Pp > > +.Nm which > > +will show duplicates if the same executable is find more than once: > > found? Sorry for that. Fixed in r366122. Thanks! > > > +.Bd -literal -offset indent > > +$ PATH=/bin:/bin /usr/bin/which -a ls > > +/bin/ls > > +/bin/ls > > +.Ed > > +.Pp > > +Do not show output. > > +Just exit with an appropriate return code: > > +.Bd -literal -offset indent > > +$ /usr/bin/which -s ls cp > > +$ echo $? > > +0 > > + > > +$ /usr/bin/which -s fakecommand > > +$ echo $? > > +1 > > +.Ed > > .Sh SEE ALSO > > .Xr builtin 1 , > > .Xr csh 1 , > > ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366148 - head/contrib/nvi/man
Author: fernape (ports committer) Date: Fri Sep 25 10:20:12 2020 New Revision: 366148 URL: https://svnweb.freebsd.org/changeset/base/366148 Log: vi(1): Add URL to the vi/ex reference manual in the man page Reported in PR 241985 The manual page references the "vi/ex reference manual" but there is no information about where to find that document. Add a reference to the manual in the SEE ALSO section since the Project hosts a copy of it[1]. Change sent upstream[2] If D26158 gets reviewed and committed, we could close that PR. [1] https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf). [2] https://github.com/lichray/nvi2/pull/85 Submitted by: free...@tim.thechases.com Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D26163 Modified: head/contrib/nvi/man/vi.1 Modified: head/contrib/nvi/man/vi.1 == --- head/contrib/nvi/man/vi.1 Fri Sep 25 10:05:38 2020(r366147) +++ head/contrib/nvi/man/vi.1 Fri Sep 25 10:20:12 2020(r366148) @@ -12,7 +12,7 @@ .\" that you would have purchased it, or if any company wishes to .\" redistribute it, contributions to the authors would be appreciated. .\" -.Dd November 2, 2013 +.Dd September 25, 2020 .Dt VI 1 .Os .Sh NAME @@ -2743,6 +2743,10 @@ and \*(Gt0 if an error occurs. .Xr ctags 1 , .Xr iconv 1 , .Xr re_format 7 +.Rs +.%T vi/ex reference manual +.%U https://docs.freebsd.org/44doc/usd/13.viref/paper.pdf +.Re .Sh STANDARDS .Nm nex Ns / Ns Nm nvi is close to ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366264 - head/sbin/kldconfig
Author: fernape (ports committer) Date: Tue Sep 29 17:52:15 2020 New Revision: 366264 URL: https://svnweb.freebsd.org/changeset/base/366264 Log: kldconfig(8): Add EXAMPLES to the man page Add EXAMPLES section to the man page showing the use of all flags except for -S. While here, clarify -f description. It not only suppresses diagnostic messages but it also affects the exit status of the command itself. This is shown in two of the examples. Approved by: bcr@ Differential Revision:https://reviews.freebsd.org/D26588 Modified: head/sbin/kldconfig/kldconfig.8 Modified: head/sbin/kldconfig/kldconfig.8 == --- head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:22:14 2020 (r366263) +++ head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:52:15 2020 (r366264) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2017 +.Dd September 29, 2020 .Dt KLDCONFIG 8 .Os .Sh NAME @@ -54,9 +54,8 @@ The following options are available: .It Fl d Remove the specified paths from the module search path. .It Fl f -Do not display a diagnostic message if a path specified for adding is -already present in the search path, or if a path specified for removing -is not present in the search path. +Do not fail if a path specified for adding is already present in the search +path, or if a path specified for removing is not present in the search path. This may be useful in startup/shutdown scripts for adding a path to a file system which is still not mounted, or in shutdown scripts for unconditionally removing a path that may have been added during startup. @@ -95,6 +94,69 @@ The default module search path used by the kernel. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show the module search path +.Bd -literal -offset indent +$ kldconfig -r +/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays +.Ed +.Pp +Try to delete the +.Pa /boot +directory from the search path. +The command will fail: +.Bd -literal -offset indent +$ kldconfig -d /boot +kldconfig: not in module search path: /boot +$ echo $? +1 +.Ed +.Pp +Same as above but forcing the operation. +This time the command will succeed: +.Bd -literal -offset indent +$ kldconfig -d -f /boot +$ echo $? +0 +.Ed +.Pp +Add the +.Pa /boot +directory to the beginning of the search path and display extra verbose output: +.Bd -literal -offset indent +$ kldconfig -i -m -vv /boot +/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules +.Ed +.Pp +Without +.Fl m +the +.Fl i +flag will overwrite the contents of the search path list: +.Bd -literal -offset indent +$ kldconfig -i -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Same as above but using +.Fl n +to simulate the operation without actually doing it: +.Bd -literal -offset indent +$ kldconfig -i -n -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Add directories to the search path removing duplicates. +Note the need of +.Fl f +to force the operation in case any of the directories is already in the +search path. +The +.Pa /boot/kernel +directory will be added once: +.Bd -literal -offset indent +$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays +.Ed .Sh SEE ALSO .Xr kldload 2 , .Xr kldload 8 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366444 - head/bin/pwait
Author: fernape (ports committer) Date: Mon Oct 5 13:35:34 2020 New Revision: 366444 URL: https://svnweb.freebsd.org/changeset/base/366444 Log: pwait(1): Add EXAMPLES section to man page * Add small EXAMPLES section to the man page showing the different flags and exit codes. * Complete description for -v flag. Approved by: manpages (bcr@) Modified: head/bin/pwait/pwait.1 Modified: head/bin/pwait/pwait.1 == --- head/bin/pwait/pwait.1 Mon Oct 5 09:03:17 2020(r366443) +++ head/bin/pwait/pwait.1 Mon Oct 5 13:35:34 2020(r366444) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 26, 2020 +.Dd October 5, 2020 .Dt PWAIT 1 .Os .Sh NAME @@ -73,7 +73,9 @@ minutes hours .El .It Fl v -Print the exit status when each process terminates. +Print the exit status when each process terminates or +.Ql timeout +if the timer goes off earlier. .El .Sh EXIT STATUS The @@ -85,6 +87,52 @@ If the flag is specified and a timeout occurs, the exit status will be 124. .Pp Invalid pids elicit a warning message but are otherwise ignored. +.Sh EXAMPLES +Start two +.Xr sleep 1 +processes in the background. +The first one will sleep for 30 seconds and the second one for one hour. +Wait for any of them to finish but no more than 5 seconds. +Since a timeout occurs the exit status is 124: +.Bd -literal -offset indent +$ sleep 30 & sleep 3600 & +[1] 1646 +[2] 1647 +$ pwait -o -t5 1646 1647 +$? +124 +.Ed +.Pp +Same as above but try to obtain the exit status of the processes. +In this case +.Ql timeout +is shown and the exit status is 124: +.Bd -literal -offset indent +$ sleep 30 & sleep 3600 & +[1] 1652 +[2] 1653 +$ pwait -v -t 5 1652 1653 +timeout +$? +124 +.Ed +.Pp +Start two +.Xr sleep 1 +processes in the background sleeping for 30 and 40 seconds respectively. +Wait 60 seconds for any of them to finish and get their exit codes: +.Bd -literal -offset indent +$ sleep 30 & sleep 40 & +[1] 1674 +[2] 1675 +$ pwait -v -t 60 1674 1675 +1674: exited with status 0. +1675: exited with status 0. +[1]- Donesleep 30 +[2]+ Donesleep 40 +$ echo $? +0 +.Ed .Sh SEE ALSO .Xr kill 1 , .Xr pkill 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366445 - head/bin/df
Author: fernape (ports committer) Date: Mon Oct 5 13:39:37 2020 New Revision: 366445 URL: https://svnweb.freebsd.org/changeset/base/366445 Log: df(1): Add EXAMPLES section to man page * Add EXAMPLES section with four simple examples. * Simplify -H flag description. This makes easy to see the difference between this flag and -h * While here, fix .Tn deprecated macro. Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26662 Modified: head/bin/df/df.1 Modified: head/bin/df/df.1 == --- head/bin/df/df.1Mon Oct 5 13:35:34 2020(r366444) +++ head/bin/df/df.1Mon Oct 5 13:39:37 2020(r366445) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd August 8, 2017 +.Dd October 5, 2020 .Dt DF 1 .Os .Sh NAME @@ -98,12 +98,9 @@ Use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Pebibyte (based on powers of 1024) in order to reduce the number of digits to four or fewer. .It Fl H , Fl Fl si -.Dq Human-readable -output. -Use unit suffixes: Byte, Kilobyte, Megabyte, -Gigabyte, Terabyte and Petabyte (based on powers of 1000) in order to -reduce the number of -digits to four or fewer. +Same as +.Fl h +but based on powers of 1000. .It Fl i Include statistics on the number of free and used inodes. In conjunction with the @@ -159,10 +156,7 @@ command: df -t nonfs,nullfs .Ed .Pp -lists all file systems except those of type -.Tn NFS -and -.Tn NULLFS . +lists all file systems except those of type NFS and NULLFS. The .Xr lsvfs 1 command can be used to find out the types of file systems @@ -193,6 +187,52 @@ which allows units of bytes or numbers scaled with the The allowed range is 512 bytes to 1 GB. If the value is outside, it will be set to the appropriate limit. .El +.Sh EXAMPLES +Show human readable free disk space for all mount points including file system +type: +.Bd -literal -offset indent +$ df -ahT +Filesystem TypeSizeUsed Avail Capacity Mounted on +/dev/ada1p2 ufs 213G152G 44G78%/ +devfsdevfs 1.0K1.0K 0B 100%/dev +/dev/ada0p1 ufs 1.8T168G1.5T10%/data +linsysfs linsysfs4.0K4.0K 0B 100%/compat/linux/sys +/dev/da0 msdosfs 7.6G424M7.2G 5%/mnt/usb +.Ed +.Pp +Show previously collected data including inode statistics except for devfs or +linsysfs file systems. +Note that the +.Dq no +prefix affects all the file systems in the list and the +.Fl t +option can be specified only once: +.Bd -literal -offset indent +$ df -i -n -t nodevfs,linsysfs +Filesystem 1K-blocks Used Avail Capacity iused ifree %iused +Mounted on +/dev/ada1p2 223235736 159618992 4575788878% 1657590 272345686% / +/dev/ada0p1 1892163184 176319420 156447071210% 1319710 2433005761% +/data +/dev/da0 79898884336647556224 5% 0 0 100% +/mnt/usb +.Ed +.Pp +Show human readable information for the file system containing the file +.Pa /etc/rc.conf +: +.Bd -literal -offset indent +$ df -h /etc/rc.conf +Filesystem SizeUsed Avail Capacity Mounted on +/dev/ada1p2213G152G 44G78%/ +.Ed +.Pp +Same as above but specifying some file system: +.Bd -literal -offset indent +$ df -h /dev/ada1p2 +Filesystem SizeUsed Avail Capacity Mounted on +/dev/ada1p2213G152G 44G78%/ +.Ed .Sh SEE ALSO .Xr lsvfs 1 , .Xr quota 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366446 - head/bin/hostname
Author: fernape (ports committer) Date: Mon Oct 5 13:46:19 2020 New Revision: 366446 URL: https://svnweb.freebsd.org/changeset/base/366446 Log: 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 Modified: head/bin/hostname/hostname.1 Modified: head/bin/hostname/hostname.1 == --- head/bin/hostname/hostname.1Mon Oct 5 13:39:37 2020 (r366445) +++ head/bin/hostname/hostname.1Mon Oct 5 13:46:19 2020 (r366446) @@ -29,7 +29,7 @@ .\"@(#)hostname.1 8.2 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd November 10, 2016 +.Dd October 5, 2020 .Dt HOSTNAME 1 .Os .Sh NAME @@ -66,6 +66,25 @@ name. .It Fl d Only print domain information. .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 .Xr gethostname 3 , .Xr rc.conf 5 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366447 - head/bin/kenv
Author: fernape (ports committer) Date: Mon Oct 5 13:49:45 2020 New Revision: 366447 URL: https://svnweb.freebsd.org/changeset/base/366447 Log: kenv(1): Add EXAMPLES to man page Add EXAMPLES section covering all the options Approved by: manpages (bcr@) Differential Revision:https://reviews.freebsd.org/D26664 Modified: head/bin/kenv/kenv.1 Modified: head/bin/kenv/kenv.1 == --- head/bin/kenv/kenv.1Mon Oct 5 13:46:19 2020(r366446) +++ head/bin/kenv/kenv.1Mon Oct 5 13:49:45 2020(r366447) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2012 +.Dd October 5, 2020 .Dt KENV 1 .Os .Sh NAME @@ -102,6 +102,44 @@ Almost any printable character except .Sq = is acceptable as part of a name. Quotes are optional and necessary only if the value contains whitespace. +.Sh EXAMPLES +Show kernel probe hints variable names and filter for the uart +device +.Bd -literal -offset indent +$ kenv -h -N | grep uart +hint.uart.0.at +hint.uart.0.flags +hint.uart.0.irq +hint.uart.0.port +hint.uart.1.at +hint.uart.1.irq +hint.uart.1.port +.Ed +.Pp +Show the value of a specific variable: +.Bd -literal -offset indent +$ kenv hint.uart.1.at +isa +.Ed +.Pp +Same as above but adding the name of the variable in the report: +.Bd -literal -offset indent +$ kenv -v hint.uart.1.at +hint.uart.1.at="isa" +.Ed +.Pp +Try to delete a variable and suppress warnings if any: +.Bd -literal -offset indent +$ kenv -q -u hint.uart.1.at +.Ed +.Pp +Set the value of the +.Ev verbose_loading +variable +.Bd -literal -offset indent +$ kenv verbose_loading="YES" +verbose_loading="YES" +.Ed .Sh SEE ALSO .Xr kenv 2 , .Xr config 5 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366448 - head/bin/pkill
Author: fernape (ports committer) Date: Mon Oct 5 13:52:31 2020 New Revision: 366448 URL: https://svnweb.freebsd.org/changeset/base/366448 Log: pkill(1): Add EXAMPLES section to man page Add a dozen of examples to the EXAMPLES section for pgrep(1) and pkill(1). Flags covered: -f, -F, -n, -j, -l, -S, -x Approved by: mandoc (bcr@) Differential Revision:pkill(1): Add EXAMPLES section to man page Modified: head/bin/pkill/pkill.1 Modified: head/bin/pkill/pkill.1 == --- head/bin/pkill/pkill.1 Mon Oct 5 13:49:45 2020(r366447) +++ head/bin/pkill/pkill.1 Mon Oct 5 13:52:31 2020(r366448) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 3, 2018 +.Dd October 5, 2020 .Dt PKILL 1 .Os .Sh NAME @@ -270,6 +270,111 @@ Invalid options were specified on the command line. .It 3 An internal error occurred. .El +.Sh EXAMPLES +Show the pid of the process holding the +.Pa /tmp/.X0-lock +pid file: +.Bd -literal -offset indent +$ pgrep -F /tmp/.X0-lock +1211 +.Ed +.Pp +Show the pid and the name of the process including kernel threads in the +search: +.Bd -literal -offset indent +$ pgrep -lS vnlru +37 vnlru +.Ed +.Pp +Search for processes including kernel threads that match the extended regular +expression pattern: +.Bd -literal -offset indent +$ pgrep -S 'crypto.*[2-3]' +20 +19 +6 +5 +.Ed +.Pp +Show long output for firefox processes: +.Bd -literal -offset indent +$ pgrep -l firefox +1312 firefox +1309 firefox +1288 firefox +1280 firefox +1279 firefox +1278 firefox +1277 firefox +1264 firefox +.Ed +.Pp +Same as above but just showing the pid of the most recent process: +.Bd -literal -offset indent +$ pgrep -n firefox +1312 +.Ed +.Pp +Look for vim processes. +Match against the full argument list: +.Bd -literal -offset indent +$ pgrep -f vim +44968 +30790 +.Ed +.Pp +Same as above but matching against the +.Ql list +word and showing the full argument list: +.Bd -literal -offset indent +$ pgrep -f -l list +30790 vim list.txt +.Ed +.Pp +Send +.Va SIGSTOP +signal to processes that are an exact match: +.Bd -literal -offset indent +$ pkill -SIGSTOP -f -x "vim list.txt" +.Ed +.Pp +Without +.Fl f +names over 19 characters will silently fail: +.Bd -literal -offset indent +$ vim this_is_a_very_long_file_name & +[1] 36689 +$ + +[1]+ Stopped vim this_is_a_very_long_file_name +$ pgrep "vim this" +$ +.Ed +.Pp +Same as above using the +.Fl f +flag: +.Bd -literal -offset indent +$ pgrep -f "vim this" +36689 +.Ed +.Pp +Find the +.Xr top 1 +command running in any jail: +.Bd -literal -offset indent +$ pgrep -j any top +34498 +.Ed +.Pp +Show all processes running in jail ID 58: +.Bd -literal -offset indent +$ pgrep -l -j58 '.*' +28397 pkg-static +28396 pkg-static +28255 sh +28254 make +.Ed .Sh COMPATIBILITY Historically the option .Dq Fl j Li 0 ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366449 - head/usr.bin/procstat
Author: fernape (ports committer) Date: Mon Oct 5 14:07:32 2020 New Revision: 366449 URL: https://svnweb.freebsd.org/changeset/base/366449 Log: procstat(1): Add EXAMPLES section * Add some examples showing binary, arguments and file info from living processes. * Show information from core dumps including an attempt using an old core file. * While here, fix warning 'no blank before trailing delimiter' reported by igor. Approved by: manpages (0mp@) Differential Revision:https://reviews.freebsd.org/D25467 Modified: head/usr.bin/procstat/procstat.1 Modified: head/usr.bin/procstat/procstat.1 == --- head/usr.bin/procstat/procstat.1Mon Oct 5 13:52:31 2020 (r366448) +++ head/usr.bin/procstat/procstat.1Mon Oct 5 14:07:32 2020 (r366449) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2020 +.Dd October 5, 2020 .Dt PROCSTAT 1 .Os .Sh NAME @@ -710,6 +710,51 @@ auxiliary vector value .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show binary information about the current shell: +.Bd -literal -offset indent +$ procstat binary $$ + PID COMMOSREL PATH +46620 bash 1201000 /usr/local/bin/bash +.Ed +.Pp +Same as above but showing information about open file descriptors: +.Bd -literal -offset indent +$ procstat files $$ + PID COMMFD T V FLAGSREF OFFSET PRO NAME +46620 bash text v r r--- - - - /usr/local/bin/bash +46620 bash ctty v c rw-- - - - /dev/pts/12 +46620 bash cwd v d r--- - - - /tmp +46620 bash root v d r--- - - - / +46620 bash 0 v c rw-- 7 372071 - /dev/pts/12 +46620 bash 1 v c rw-- 7 372071 - /dev/pts/12 +46620 bash 2 v c rw-- 7 372071 - /dev/pts/12 +46620 bash 255 v c rw-- 7 372071 - /dev/pts/12 +.Ed +.Pp +Show the arguments used to launch +.Xr init 8 : +.Bd -literal -offset indent +$ procstat arguments 1 + PID COMM ARGS +1 init /sbin/init -- +.Ed +.Pp +Extract binary information from a core dump: +.Bd -literal -offset indent +$ procstat binary core.36642 + PID COMMOSREL PATH +36642 top 1201000 /usr/bin/top +.Ed +.Pp +Trying to extract information from a core file generated in a different major +.Fx +version might show an error like this: +.Bd -literal -offset indent +$ procstat mplayer.core +procstat: kinfo_proc structure size mismatch +procstat: procstat_getprocs() +.Ed .Sh SEE ALSO .Xr fstat 1 , .Xr ps 1 , ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r366516 - head/usr.bin/ul
Author: fernape (ports committer) Date: Wed Oct 7 14:43:16 2020 New Revision: 366516 URL: https://svnweb.freebsd.org/changeset/base/366516 Log: ul(1): Remove references to colcrt(1) and nroff(1) colcrt(1) and nroff(1) where removed in r319664. Remove references to these commands in ul(1) man page. PR: 244127 Reported by: free...@tim.thechases.com Approved by: manpages (gbe@) Differential Revision:https://reviews.freebsd.org/D2614 Modified: head/usr.bin/ul/ul.1 Modified: head/usr.bin/ul/ul.1 == --- head/usr.bin/ul/ul.1Wed Oct 7 12:11:11 2020(r366515) +++ head/usr.bin/ul/ul.1Wed Oct 7 14:43:16 2020(r366516) @@ -28,7 +28,7 @@ .\" @(#)ul.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 4, 2004 +.Dd October 7, 2020 .Dt UL 1 .Os .Sh NAME @@ -64,11 +64,7 @@ The following options are available: .It Fl i Underlining is indicated by a separate line containing appropriate dashes -.Ql \- ; -this is useful when you want to look at the underlining -which is present in an -.Xr nroff 1 -output stream on a CRT-terminal. +.Ql \- . .It Fl t Ar terminal Overrides the terminal type specified in the environment with .Ar terminal . @@ -85,18 +81,10 @@ as described in .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr colcrt 1 , .Xr man 1 , -.Xr nroff 1 +.Xr mandoc 1 .Sh HISTORY The .Nm command appeared in .Bx 3.0 . -.Sh BUGS -The -.Xr nroff 1 -command usually outputs a series of backspaces and underlines intermixed -with the text to indicate underlining. -No attempt is made to optimize -the backward motion. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"