TAR & zipping
Most of the program files you need to install on your machine will be downloaded in a compressed format that takes less time to transfer. Once on your machine, you will need to uncompress the file before you can install it. First, determine the type of file you have from the file suffix. If it ends in .tar it is probably an unzipped tar file. If it ends in .Z, .gz, .bz2 or.tgz it is probably a zipped tar file (zipping is a form of further compression). In order untar a tar file type:
tar -xvf file.tar
if it is a zipped tar file add a z to the options:
tar -zxvf file.tar.Z (except for bz2 which uses -j instead of -z)
If you want to look at the contents of a tar file before you untar it use:
tar -t filename.tar
If you then decide there is only a small part of the total tar file you actually need to extract, type:
tar -zxvf tarfile filepathIf you have a large number of files you wish to transfer you can make it simpler by tarring them first:
tar -cvf file.tar directory_to_tar
(Make sure you don’t reverse the order of “file.tar” and “directory_to_tar”). Then to zip it type:
gzip -cv file.tar
Or better yet, do it all at once with:
tar -zcvf
On our SGIs, this must be done with the command:
tar -tvf file.tar directoryname instead.
Here’s a neat trick for transferring a tar file to another machine that will tar “on the fly” rather then requiring you to create a tar file on your own machine first. (Which can be useful if you don’t have much space left.) To do this simultaneous tar, zip, and transfer type:
tar --rsh-command=`which shh` -zcvf -- --host_computer:filename.tar -- --directory_to_tar
Note that “which ssh” needs back-ticks rather than apostrophies.
After you uncompress a program tar file you will usually still have to install the program yourself. The usual directory to install programs in is /usr/local/. (You will need root permissions.) Look for a README file in the file’s source code to get further instructions.
An easier method of installing programs though is to get a rpm package rather then a tar file for a program whenever possible. Rpm packages do all the work of untarring and installing for you. A good source for these files can be found at: http://linux.s390.org/download/rpm2html/index.html or ftp://ftp.software.umn.edu/pub/linux/redhat/redhat-9-en/os/i386/RedHat/RPMS
(Note that this particular link is for people using Redhat 9 but if you go up a few directories you can get to the directory specific to the LINUX version your using).
tar zcf localfolder.tgz localfolder/
tar zcf - localfolder/ \ | ssh 192.1.1.1 "cd folder/to/copy/to; tar zpxvf -"
gzip -dc file.tar.gz | tar xf - pathname/filename The pathname and filename should be exactly as given in the .tar.gz file. If you want more than one file append their names, again include pathname, at the end of the command.