How to make a tar archive
To construct a ``tarball'' that contains copies of all the files in a particular directory subtree:
tar -cvzf name.tgz subdirwhere subdir is the name of the subdirectory you want to save. To continue the example, this command would be:
tar -cvzf rainpics.tgz pics
The -c option tells tar to create an archive. The v option tells it to write out the names of the files on your screen as it saves them, so you can be sure it is including everything you want. The z option specifies that the file should be compressed, to save space. The f option instructs tar to use the next name (in the example, rainpics.tgz) for the tarball it is building.
The last argument is the name of the directory subtree to be saved. You could use an absolute path name here, but it is not recommended, because you may be moving the tarball to a system that has different directories. That's why we recommend you use a relative path name here.
Once your tarball file is completed, you can move or copy it elsewhere on the system, or to a different system altogether.
John Shipman, email@example.com
Last updated: 2000/09/20 21:22:12 UT