uncompress (1) - compress or expand files
I like to copy the error_log as tmp_log and then compress and compress it as shown below: # ls -l error_log
-rw-r--r-- 1 root root 2409238 2011-04-08 00:33 error_log
# du -sh error_log2.4M error_log
# file error_logerror_log: ascii textg
# cp error_log tmp_log # du -sh tmp_log2.4M tmp_log
# file tmp_logtmp_log: ascii textg
# compress tmp_log # file tmp_log*gtmp_log.Z: compressed data block compressed 16 bitsg
# ls -l tmp_log.Z-rw-r--r-- 1 root root 231605 2011-04-08 01:00 tmp_log.Z
# du -sh tmp_log.Z259K tmp_log.Z
# zcat tmp_log.Z | tail -10g[Fri Apr 08 00:27:38 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::arg" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::cmdargs" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::cmdbase" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::arg" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::cmdargs" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::cmdbase" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Can't open the file! at /var/apache2/2.2/cgi-bin/CH3.cgi line 37., referer: https://www.mywebuniversity.com/chapter-3.htmlg
# compress -d tmp_log # ls -l tmp_log-rw-r--r-- 1 root root 2409238 2011-04-08 01:00 tmp_log
# file tmp_logtmp_log: ascii textg
# tail -10 tmp_log[Fri Apr 08 00:27:38 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::arg" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::cmdargs" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::cmdbase" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:28:19 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::arg" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::cmdargs" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::cmdbase" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 31., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Name "main::mycmd" used only once: possible typo at /var/apache2/2.2/cgi-bin/CH3.cgi line 29., referer: https://www.mywebuniversity.com/chapter-3.htmlg [Fri Apr 08 00:33:43 2011] [error] [client 173.51.166.200] Can't open the file! at /var/apache2/2.2/cgi-bin/CH3.cgi line 37., referer: https://www.mywebuniversity.com/chapter-3.htmlg
# file tmp_logtmp_log: ascii textg
# du -sh tmp_log2.4M tmp_log
# compress -f tmp_log # ls -ld tmp_log*-rw-r--r-- 1 root root 231605 2011-04-08 01:00 tmp_log.Z
# du -sh tmp_log.Z259K tmp_log.Z
# file tmp_log.Ztmp_log.Z: compressed data block compressed 16 bitsg
#zcat tmp_log.Z | head -5[Fri Feb 18 20:43:52 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]g [Fri Feb 18 20:43:53 2011] [notice] Digest: generating secret for digest authentication ...g [Fri Feb 18 20:43:53 2011] [notice] Digest: doneg [Fri Feb 18 20:43:54 2011] [notice] Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8o DAV/2 PHP/5.2.12 mod_fcgid/2.3.4 configured -- resuming normal operationsg [Fri Feb 18 21:07:57 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]g
# uncompress -d tmp_log.Z# ls -l tmp_log.Z
-rw-r--r-- 1 root root 2409238 2011-04-08 01:00 tmp_log
# file tmp_logtmp_log: ascii textg
# head -5 tmp_log[Fri Feb 18 20:43:52 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]g [Fri Feb 18 20:43:53 2011] [notice] Digest: generating secret for digest authentication ...g [Fri Feb 18 20:43:53 2011] [notice] Digest: doneg [Fri Feb 18 20:43:54 2011] [notice] Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8o DAV/2 PHP/5.2.12 mod_fcgid/2.3.4 configured -- resuming normal operationsg [Fri Feb 18 21:07:57 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]g
Please click on " uncompress in PDF " format.
Please click on " uncompress in HTML " format.