Creating and Reading Archives
has plenty of features; some people would say "too many."
I don't agree.
has features I wish I'd had for years in more
This article lists my favorites.
For a complete list, check the documentation on the CD-ROM.
describes how to compress an archive file you've created.
using GNU tar
, this is even easier, since tar
do the compression.
Simply use the z
option when writing or reading archives.
For example, to make the gzip
ped tar archive progs.tar.gz
from all ".c" and ".h" files:
tar cvzf progs.tar.gz *.c *.h
Compressed tape archives aren't recommended
because error recovery can be difficult.
I've made the classic mistake of
archiving files with their absolute pathnames (20.10
saves you from that goof.
It always stores absolute pathnames as relative paths unless you add the
Often I want to make a tape backup of my most recent work on a big
project, but not all the thousands of files in a directory tree.
The clumsy way to do that is by using find -mtime
an include-file for the standard tar -I
GNU tar to the rescue: its --after-date
option lets me
tell it what directories to look in and how recently the files should
have been changed.
When I extract an archive, I may be writing into a directory that
has other files.
option tells GNU tar
overwrite existing files.
One caution about GNU tar
it creates ANSI-format tar
Extracting one of these archives with the old V7 tar
warning messages like "tar: unexpected EOF."
But, of course, GNU tar
has an option to create old-format