- Creating a tar file:
- Opening a tar file:
- Creating a gzip archive:
- Opening a gzip archive:
- Creating a Unix-Compressed archive:
- Opening a Unix-Compressed archive:
- Creating a zip archive:
- Opening a zip archive:
- Creating a bzip2 archive:
- Opening a bzip2 archive:
- Creating a cpio archive:
- Opening a cpio archive:
# tar cf filename.tar file1 file2 dir1 dir2 where: filename.tar is the tar archive you are creating file 1 and file2 are plain files to be archived dir1 and dir2 are directories to be archived
# tar xf filename.tar where: filename.tar is the tar archive you want to open
# gzip filename.tar where: filename.tar is the file you want to compress The result of this would be filename.tar.gz
# gzip -d filename.tar.gz where: filename.tar.gz is the file to be uncompressed The result of this would be filename.tar
# compress filename.tar where: filename.tar is the file to be compressed The result of this would be filename.tar.Z
# uncompress filename.tar.Z where: filename.tar.Z is the file to be uncompressed The result of this would be filename.tar
# zip -r filename.zip file1 file2 dir1 dir2 where: filename.zip is the archive to be created file1 and file2 are plain files to be added dir1 and dir2 are directories to be added
# unzip filename.zip where: filename.zip is the archive to be opened This is the same zip format supported by windoze
# bzip2 filename.tar where: filename.tar is the file to be compressed The result is filename.tar.bz2
# bzip2 -d filename.tar.bz2 where: filename.tar.bz2 is the archive to be opened The result is filename.tar
# find . -depth -print | cpio -ovcB > /dev/rmt/0 where: /dev/rmt/0 is the first tape device Alternately, you could specify a filename
# cpio -ivcB < /dev/rmt/0 where: /dev/rmt/0 is the first tape device Alternately, You could specify a filename