1. Creating a tar file:
  2. # 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
    
    
  3. Opening a tar file:
  4. # tar xf filename.tar
    
    where:	filename.tar is the tar archive you want to open
    
    
  5. Creating a gzip archive:
  6. # gzip filename.tar
    
    where:  filename.tar is the file you want to compress
    	The result of this would be filename.tar.gz
    
    
  7. Opening a gzip archive:
  8. # gzip -d filename.tar.gz
    
    where:	filename.tar.gz is the file to be uncompressed
    	The result of this would be filename.tar
    
    
  9. Creating a Unix-Compressed archive:
  10. # compress filename.tar
    
    where:  filename.tar is the file to be compressed
            The result of this would be filename.tar.Z
    
    
  11. Opening a Unix-Compressed archive:
  12. # uncompress filename.tar.Z
    
    where:  filename.tar.Z is the file to be uncompressed
            The result of this would be filename.tar
    
    
  13. Creating a zip archive:
  14. # 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
    
    
  15. Opening a zip archive:
  16. # unzip filename.zip
    
    where:  filename.zip is the archive to be opened
    	This is the same zip format supported by windoze
    
    
  17. Creating a bzip2 archive:
  18. # bzip2 filename.tar
    
    where:  filename.tar is the file to be compressed
    	The result is filename.tar.bz2
    
    
  19. Opening a bzip2 archive:
  20. # bzip2 -d filename.tar.bz2
    
    where:  filename.tar.bz2 is the archive to be opened
    	The result is filename.tar
    
    
  21. Creating a cpio archive:
  22. # find  . -depth  -print | cpio -ovcB > /dev/rmt/0
    
    where:	/dev/rmt/0 is the first tape device
    	Alternately, you could specify a filename
    
    
  23. Opening a cpio archive:
  24. # cpio -ivcB < /dev/rmt/0
    
    where:	/dev/rmt/0 is the first tape device
    	Alternately, You could specify a filename