[Modified Tuesday, Dec 31st 2002 by Ana Rita Cabo]
To create a single file (archive) from various files, use tar
tar cf archive.tar file1 file2 (...)
Where archive.tar is the archive contaning file1, file2 (...)
To extract various files from an archive tar file, use tar
tar xf archive.tar
Note: tar does not compress!
To compress/decompress only one file, use gzip
gzip file_name
gunzip file_name.gz
Often tar and gz are used together to obtain a compressed archive
tar cf archive.tar file_name1 file_name2
gzip archive.tar
this will produce a archive.tar.gz file
To decompress use,
gunzip file_name.gz
tar xf archive.tar
Luckily, these steps can be done in one single step by using the
z argument.
To compress,
tar cfz archive.tar file_name1 file_name
To decompress
tar xfz archive.tar
Alternatively, one can also use zip to compress various files
zip file_name.zip file_name1 file_name2
To decompress a file having various files in it using zip
unzip file_name.zip
|