tar—stores and retrieves files from an archive file, normally a tape device

tar [ – ] c|r|t|u|x [ bBefFhilmopvwX0134778 ] [ tarfile ][ blocksize ] [ exclude–file ] [ –I include–file ]filename1 filename2 … –C directory filenameN …

Example A.46.
1   tar cvf /dev/diskette
2   tar tvf /dev/fd0
3   tar xvf /dev/fd0

EXPLANATION

  1. Sends all files under the present working directory to tape at device /dev/diskette, and prints the files that are being sent.

  2. Displays the table of contents of what is on tape device /dev/fd0.

  3. Extracts all files from tape and prints which files were extracted.

Get UNIX® Shells by Example, Third Edition 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.