O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using tar to Back Up and Restore Files

You will find that this section on tar uses much of the same wording as in the following section on cpio. The two commands have similar functionality, and only some specific details and examples change the two sections. The tar and cpio sections are complete in themselves without complicated references to one another, but if you read them both, you’ll get a strong sense of déjà vu.

Backing Up a Directory Subtree

tar stands for tape archive utility because typical UNIX backups are done on a tape drive. tar can also back up to a disk or a disk file. This is an example of a basic tar command to back up one complete directory:

$ cd /usr/fred/projects
$ tar cvf /dev/XXX? .

First use cd to change to the directory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required