summaryrefslogtreecommitdiff
path: root/slackbook/html/archive-files.html
blob: c29542a9581cc3b66691150f94f4923c178eab88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Archive Files</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="PREVIOUS" title="Keeping Current" href="security-current.html" />
<link rel="NEXT" title="bzip2" href="archive-files-bzip2.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="CHAPTER" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>

<tr>
<td width="10%" align="left" valign="bottom"><a href="security-current.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom"></td>
<td width="10%" align="right" valign="bottom"><a href="archive-files-bzip2.html"
accesskey="N">Next</a></td>
</tr>
</table>

<hr align="LEFT" width="100%" />
</div>

<div class="CHAPTER">
<h1><a id="ARCHIVE-FILES" name="ARCHIVE-FILES"></a>Chapter 15 Archive Files</h1>

<div class="TOC">
<dl>
<dt><b>Table of Contents</b></dt>

<dt>15.1 <a href="archive-files.html#ARCHIVE-FILES-GZIP"><tt
class="COMMAND">gzip</tt></a></dt>

<dt>15.2 <a href="archive-files-bzip2.html"><tt class="COMMAND">bzip2</tt></a></dt>

<dt>15.3 <a href="archive-files-tar.html"><tt class="COMMAND">tar</tt></a></dt>

<dt>15.4 <a href="archive-files-zip.html"><tt class="COMMAND">zip</tt></a></dt>
</dl>
</div>

<div class="SECT1">
<h1 class="SECT1"><a id="ARCHIVE-FILES-GZIP" name="ARCHIVE-FILES-GZIP">15.1 <tt
class="COMMAND">gzip</tt></a></h1>

<p><tt class="COMMAND">gzip</tt>(1) is the GNU compression program. It takes a single
file and compresses it. The basic usage is as follows:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">gzip <var
class="REPLACEABLE">filename</var></kbd>
</pre>
</td>
</tr>
</table>

<p>The resulting file will be named <tt class="FILENAME"><var
class="REPLACEABLE">filename</var>.gz</tt> and will usually be smaller than the input
file. Note that <tt class="FILENAME">filename.gz</tt> will replace <tt
class="FILENAME">filename</tt>. This means that <tt class="FILENAME">filename</tt> will
no longer exist, even though a gzipped copy will. Regular text files will compress
nicely, while jpeg images, mp3s, and other such files will not compress too well as they
are already compressed. This basic usage is a balance of final file size and compression
time. The maximum compression can be achieved like so:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">gzip -9 <var
class="REPLACEABLE">filename</var></kbd>
</pre>
</td>
</tr>
</table>

<p>This will take a longer time to compress the file, but the result will be as small as
<tt class="COMMAND">gzip</tt> can make it. Using lower values for the command line option
will cause it to compress faster, but the file will not be as compressed.</p>

<p>Decompressing gzipped files can be done using two commands, which are really just the
same program. <tt class="COMMAND">gzip</tt> will decompress any file with a recognized
file extension. A recognized extension can be any of the following: <tt
class="FILENAME">.gz</tt>, <tt class="FILENAME">-gz</tt>, <tt class="FILENAME">.z</tt>,
<tt class="FILENAME">-z</tt>, <tt class="FILENAME">.Z</tt>, or <tt
class="FILENAME">-Z</tt>. The first method is to call <tt class="COMMAND">gunzip</tt>(1)
on a file, like so:</p>

<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre class="SCREEN">
<samp class="PROMPT">%</samp> <kbd class="USERINPUT">gunzip <var
class="REPLACEABLE">filename.gz</var></kbd>
</pre>
</td>
</tr>
</table>

<p>This will leave a decompressed version of infile in the current directory, and the <tt
class="FILENAME">.gz</tt> extension will be stripped from the filename. <tt
class="COMMAND">gunzip</tt> is really part of <tt class="COMMAND">gzip</tt> and is
identical to <tt class="COMMAND">gzip -d</tt>. As such, <tt class="COMMAND">gzip</tt> is
often pronounced <tt class="COMMAND">gunzip</tt>, as that name just sounds cooler.
:^)</p>
</div>
</div>

<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="security-current.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="archive-files-bzip2.html"
accesskey="N">Next</a></td>
</tr>

<tr>
<td width="33%" align="left" valign="top">Keeping Current</td>
<td width="34%" align="center" valign="top">&nbsp;</td>
<td width="33%" align="right" valign="top"><tt class="COMMAND">bzip2</tt></td>
</tr>
</table>
</div>
</body>
</html>