8.2 File Archiving, Compression and Conversion
tar [options] [directory file]
c create an archive (begin writting at the start of the file)
t table of contents list
x extract from an archive
f archive file name
b archive block size
tar will accept its options either with or without a preceding hyphen (-). The archive file can be a disk file, a tape device, or standard input/output. The latter are represented by a hyphen.
Given the files and size indications below:
tar can combine these into one file, logfile.tar:
% tar -cf logfile.tar logs.* ; ls -s logfile.tar
Many anonymous FTP archive sites on the Internet store their packages in compressed tar format, so the files will end in .tar.Z or .tar.gz. To extract the files from these files you would first uncompress them, or use the appropriate zcat command and pipe the output into tar, e.g.:
% zcat archive.tar.Z | tar -xvf -
where the hyphen at the end of the tar command indicates that the file is taken from stdin.