diff options
| author | Fernando ApesteguĂa <fernape@FreeBSD.org> | 2020-10-20 13:05:25 +0000 |
|---|---|---|
| committer | Fernando ApesteguĂa <fernape@FreeBSD.org> | 2020-10-20 13:05:25 +0000 |
| commit | ea772485d1da1efa92e8f4a15f7c8941afe7adb2 (patch) | |
| tree | 65ca49f28d8baa6b756f7a3d782b11b9e79a0cdd /usr.bin | |
| parent | e9fb2bd9b8328e461d7f9b140e9beeb3d0d5730c (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/compress/compress.1 | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/usr.bin/compress/compress.1 b/usr.bin/compress/compress.1 index 8569891f5cc9c..de44653775eae 100644 --- a/usr.bin/compress/compress.1 +++ b/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 @@ utility exits 2 if attempting to compress a file would not reduce its size 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 , |
