[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

System User's Guide: Operating System and Devices

Archiving Files (tar Command)

You can write files to or retrieve files from an archive storage with the tar command. The tar command looks for archives on the default device (usually tape), unless you specify another device.

When writing to an archive, the tar command uses a temporary file (the /tmp/tar* file) and maintains in memory a table of files with several links. You receive an error message if the tar command cannot create the temporary file or if there is not enough memory available to hold the link tables.

For example, to write the file1 and file2 files to a new archive on the default tape drive, type:

tar -c file1 file2

Press Enter.

For example, to extract all files in the /tmp directory from the archive file on the /dev/rmt2 tape device and use the time of extraction as the modification time, type:

tar -xm -f/dev/rmt2 /tmp

Press Enter.

For example, to display the names of the files in the out.tar disk archive file from the current directory, type:

tar -vtf out.tar

Press Enter.

See the tar command in the AIX 5L Version 5.1 Commands Reference for more information and the exact syntax.

Related Information

Commands Overview

Processes Overview

Chapter 4, Input and Output Redirection

File Systems

Directory Overview

Chapter 6, Files

Chapter 9, File and System Security

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]