Page MenuHomeFreeBSD

D26865.diff
No OneTemporary

D26865.diff

Index: head/usr.bin/compress/compress.1
===================================================================
--- head/usr.bin/compress/compress.1
+++ head/usr.bin/compress/compress.1
@@ -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 @@
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 ,

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 16, 11:13 AM (17 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28776326
Default Alt Text
D26865.diff (1 KB)

Event Timeline