Novell LINUX ENTERPRISE SERVER 10 - INSTALLATION AND ADMINISTRATION 11-05-2007 Installation Manual page 360

Table of Contents

Advertisement

17.1.5 Archives and Data Compression
Now that you have already created a number of files and directories, consider the subject
of archives and data compression. Suppose you want to have the entire test directory
packed in one file that you can save on a USB stick as a backup copy or send by e-mail.
To do so, use the command tar (for tape archiver). With tar --help, view all the
options for the tar command. The most important of these options are explained here:
-c
(for create) Create a new archive.
-t
(for table) Display the contents of an archive.
-x
(for extract) Unpack the archive.
-v
(for verbose) Show all files on screen while creating the archive.
-f
(for file) Choose a filename for the archive file. When creating an archive, this
option must always be given as the last one.
To pack the test directory with all its files and subdirectories into an archive named
testarchive.tar, do the following:
1 Open a shell.
2 Use cd to your home directory where the test directory is located.
3 Enter tar -cvf testarchive.tar test. The -c option creates the
4 View the contents of the archive file with tar -tf testarchive.tar.
The test directory with all its files and directories has remained unchanged on your
hard disk. To unpack the archive, enter tar -xvf testarchive.tar, but do not
try this yet.
342
Installation and Administration
archive, making it a file as directed by -f. The -v option lists the files as they
are processed.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Suse linux enterprise server 10

Table of Contents