Thursday, November 21, 2024
HomeUNIXCreate a TAR Archive of a Directory

Create a TAR Archive of a Directory

A common task in linux and UNIX operating systems is to create an archive of many files or directories in a single file. The tar command is one option for archiving and has many options and can do many things.


Wrapping an entire directory structure into a tar archive is extremely useful. This simple command will allow you to create a tar archive that contains a preserved hierarchy of directories.

In a simple example, you can create a file called archive.tar of all the files and subdirectories in the current directory with the following command:

tar cf archive.tar *

Note that this file is different from a zip archive commonly used in Windows environments because it is uncompressed.

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!