The tar Command



next up previous contents index
Next: Creating tar Archives Up: Reading and Writing Previous: Reading and Writing

The tar Command

Although there are several commands for archiving files, not all are found on every system (for example cpio). Specifically, while many Unix systems have a backup command for archiving files, the file structure it produces tends to be more system-dependent than the tar format, and so we concentrate on the latter. You should be able to read a tar tape, diskette, or electronic file made on another workstation provided you have the necessary drive with which to read it.    

Note that the tar command is also very useful for producing a single file containing many files, say, of all your projects. This single file is then easily transported or emailed with just one command, and then ``untarred'' at the other end. This is one way of avoiding the maximum limit for files on a floppy. (As indicated in one of the examples below, one then uses the -f option with a file name rather than a device.)

A command pax is available on many machines as a new Posix standard. The pax command is more flexible than tar, creates archives that can be read by the older tar command, and can read tar archives as well.


OPTIONS FOR tar
-t
Table of contents of files in archive.
-x
Extract files from tar archive.
-c
Create an archive.
-v
Verbose list of files as read.
-f name
Output to file or device name for archive.





next up previous contents index
Next: Creating tar Archives Up: Reading and Writing Previous: Reading and Writing