Red Hat ENTERPRISE LINUX 4 - STEP BY STEP GUIDE Manual page 54

Table of Contents

Advertisement

40
Table 3-1. Compression Tools
By convention, files compressed with
are given the extension
gzip
Files compressed with
compressed with
gunzip
3.4.2.1. Bzip2 and Bunzip2
To use
to compress a file, enter the following command at a shell prompt:
bzip2
bzip2 filename
The file is compressed and saved as
To expand the compressed file, enter the following command:
bunzip2 filename.bz2
The
filename.bz2
You can use
to compress multiple files and directories at the same time by listing them with a
bzip2
space between each one:
bzip2 filename.bz2 file1 file2 file3 /usr/work/school
The above command compresses
/usr/work/school/
.
filename.bz2
Tip
For more information, enter
for
and
bzip2
bunzip2
3.4.2.2. Gzip and Gunzip
To use
to compress a file, enter the following command at a shell prompt:
gzip
gzip filename
The file is compressed and saved as
To expand the compressed file, enter the following command:
gunzip filename.gz
The
compressed file is deleted and replaced with
filename.gz
You can use
to compress multiple files and directories at the same time by listing them with a
gzip
space between each one:
gzip -r filename.gz file1 file2 file3 /usr/work/school
bzip2
, and files compressed with
.gz
are uncompressed with
bzip2
, and files compressed with
filename.bz2
compressed file is deleted and replaced with
file1
directory (assuming this directory exists) and places them in a file named
man bzip2
.
filename.gz
Chapter 3. Managing Files and Directories
are given the extension
zip
bunzip2
are uncompressed with
zip
.
,
,
file2
file3
and
at a shell prompt to read the man pages
man bunzip2
.
, files compressed with
.bz2
are given the extension
, files compressed with
unzip
.
filename
, and the contents of the
.
filename
.
.zip
are un-
gzip
.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents