git: 70445a806122 - main - cksum(1): Add EXAMPLES to manual page
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Jan 2024 13:05:36 UTC
The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/src/commit/?id=70445a8061226ad46a7079ce8ad96e89ae45d6c5 commit 70445a8061226ad46a7079ce8ad96e89ae45d6c5 Author: Fernando Apesteguía <fernape@FreeBSD.org> AuthorDate: 2023-09-08 12:27:59 +0000 Commit: Fernando Apesteguía <fernape@FreeBSD.org> CommitDate: 2024-01-18 13:04:25 +0000 cksum(1): Add EXAMPLES to manual page Approved by: bcr@ --- usr.bin/cksum/cksum.1 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/usr.bin/cksum/cksum.1 b/usr.bin/cksum/cksum.1 index debd77de87ff..cd9b78c12306 100644 --- a/usr.bin/cksum/cksum.1 +++ b/usr.bin/cksum/cksum.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 1995 +.Dd January 18, 2024 .Dt CKSUM 1 .Os .Sh NAME @@ -149,6 +149,20 @@ The bit sequence is complemented and the result is the CRC. .Ed .Sh EXIT STATUS .Ex -std cksum sum +.Sh EXAMPLES +Compute the checksum for all available algorithms. +Notice the difference in the size representation (in bytes for algorithm 1 and 2 +and in blocks for 3 and the default algorithm): +.Bd -literal -offset indent +$ echo "hello" | cksum +3015617425 6 +$ echo "hello" | cksum -o 1 +36979 1 +$ echo "hello" | cksum -o 2 +542 1 +$ echo "hello" | cksum -o 3 +909783072 6 +.Ed .Sh SEE ALSO .Xr md5 1 .Pp