Technical Briefs
ROHAN help Files
![]()
archive options
An archive is a single, usually compressed file that contains many related files and directories. Most files available on ftp sites, bulletin boards, etc. are distributed as archives. This is mainly because only one file transfer operation is required to get all the files, and, if the files are also compressed, the transfer time is lessoned because of the significant reduction in size.
The most commonly used UNIX archive format is tar. tar does not compress files, it only groups them into an archive that can contain many files and directories. tar allows the user to send complete directories that include binary files and links while preserving the file ownership and access permissions.
To create a tar archive, at the ROHAN prompt type:
rohan% tar cf newfile.tar directoryname/*This command creates a new file named newfile.tar that contains all of the files and information that is contained in the directory called directoryname.
To create a compressed archive, the gzip or the compress commands can be used on the tar file to significantly reduce its size. When gzip and compress process a file, they replace it with a compressed file that has a .GZ extension (gzip) or a .Z extension (compress).
NOTE: The compress command is the old UNIX standard that is still used today, but gzip is more commonly used and is compatible with the old compress format.
To compress the file named work.tar, at the ROHAN prompt type:
rohan% gzip work.taror
rohan% compress work.tarThe file work.tar will now be replaced with a compressed file named work.tar.GZ or work.tar.Z.
To compress a copy of the file, type:
rohan% gzip -c work.tar > done.tar.GZor
rohan% compress -c work.tar > done.tar.ZThis will create a new file named done.tar.GZ or done.tar.Z and leave the original file untouched.
A compressed file that needs to be expanded, can be restored by using the gunzip or uncompress command. At the ROHAN prompt type:
rohan% gunzip done.tar.GZor
rohan% uncompress done.tar.ZAs with the compress program, the file done.tar.Z will be replaced by the extracted file done.tar. To leave the original file compressed and make a copy named alldone.tar, at the ROHAN prompt type:
rohan% gunzip -c done.tar.GZ > alldone.taror
rohan% uncompress -c done.tar.GZ > alldone.tarOnce the file has been expanded, the archive still must be extracted to re-create the directory structure of the original files. At the ROHAN prompt type:
rohan% tar -xvf alldone.tarUnlike the gunzip and the uncompress programs, tar will leave the original archive untouched, so it needs to be removed when it's no longer needed.
![]()