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

Table of Contents

Advertisement

Chapter 3. Managing Files and Directories
The above command compresses
/usr/work/school/
.
filename.gz
Tip
For more information, enter
and
gzip
gunzip
3.4.2.3. Zip and Unzip
To compress a file with
zip -r filename.zip filesdir
In this example,
filename.zip
directory you want to put in the new zip file. The
contained in the
filesdir
To extract the contents of a
unzip filename.zip
You can use
to compress multiple files and directories at the same time by listing them with a
zip
space between each one:
zip -r filename.zip file1 file2 file3 /usr/work/school
The above command compresses
/usr/work/school/
.
filename.zip
Tip
For more information, enter
and
.
unzip
3.4.3. Archiving Files at the Shell Prompt
A
file is a collection of several files and/or directories in one file. This is a good way to create
tar
backups and archives.
Some of
's options include:
tar
— create a new archive
-c
— when used with the
-f
when used with the
— show the list of files in the
-t
file1
directory (assuming this directory exists) and places them in a file named
man gzip
.
, enter the following command:
zip
represents the file you are creating and
directory recursively.
file, enter the following command:
zip
file1
directory (assuming this directory exists) and places them in a file named
and
man zip
option, use the filename specified for the creation of the
-c
option, unarchive the specified file
-x
file
tar
,
,
file2
file3
and
at a shell prompt to read the man pages for
man gunzip
option specifies that you want to include all files
-r
,
,
file2
file3
at a shell prompt to read the man pages for
man unzip
, and the contents of the
represents the
filesdir
, and the contents of the
41
zip
file;
tar

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents