Unarchiving Files with tar

You’ll also use tar to unarchive files, where you take all of the individual files out of the single tarred file—like dumping the bunch of toys out of the toy box—as shown in Code Listing 13.6.

Code Listing 13.6. Untarring files reconstructs the original directory structure.
[ejr@hobbes compression]$ tar -xflabrea.tar
[ejr@hobbes compression]$ ls -l Labrea/
total 483
-rw-r-r-1 ejr   users   53678 Jul 27
→ 10:05 bigfile.gz
-rw-r-r-1 ejr   users   128886 Jul 27
→ 10:06 mammoth.jpg
-rw-r-r-1 ejr   users   177607 Jul 27
→ 10:05 house.uue
-rw-r-r-1 ejr   users   128886 Jul 27
→ 10:06 rowboat.jpg
 [ejr@hobbes compression]$

To Unarchive Files with tar:

  • tar -xf labrea.tar

    At the shell prompt, type tar -xf (here, x means extract) followed ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.