How to Tar a File in UNIX

The common means with which to archive a batch of files within a UNIX system is by using the "tar" command. When you issue a tar command you can easily roll up a group of files. This eases the delivery of a group of files in per-session intensive applications such as the File Transfer Protocol and peer-to-peer applications. These steps describe how you can tar a file in UNIX using the command prompt.

Things You'll Need

  • Computer running UNIX
Show More

Instructions

    • 1

      Open a terminal session on your UNIX PC. Otherwise, you can Telnet into the terminal from a remote machine.

    • 2

      Once in the terminal, type "tar -cf" and do not press "Enter." The "c" indicates that you are creating a tar file, and the "f" indicates that the tar is to be given the name you specify.

    • 3

      Press the spacebar and type in the full name (with extension) you want for the file. If you're tarballing a picture, for example, you might want to type "pictures.tar."

    • 4

      Press space and enter the path of the full path to the file. Remember that the path should be relative to the location you're issuing the command from. For example, if the full path of the directory is "hdd0\home\user\pictures\pic1.jpg" and you issued the command from the "user" directory, then you'd simply have to put "pictures\pic1.jpg" in the command.

    • 5

      Press "Enter." A new file with the name you specified should now be in that directory.

Tips & Warnings

  • A detailed explanation of all of the "tar" parameters can be obtained any time by typing "tar -help."

  • It is best to navigate yourself as close as possible to the directories where your target files are located. This way, you do not have to remember long paths. (e.g. "tar -cf usr\bin\thisfile.doc usr\bin\another.doc" versus "tar -cf thisfile.doc another.doc")

  • Remember that a tarball is not compressed! If you want compression, you'll have to utilize another program, such as gzip.

  • Running the same command with the same .tar filename, but different files, will erase the original tar. Use the "tar -uf [filename] [file]" function to update the tar file with modified or new additions.

Related Searches:

Comments

You May Also Like

  • How to Tar a File in UNIX

    To tar a computer file in UNIX requires opening the command line prompt, adding a tar folder and typing in the appropriate...

  • How to Unzip a Tar.GZ Unix File

    Unix-based operating systems such as Linux and Mac OS X use ".tar.gz" files to combine and compress multiple files for storage purposes...

  • What Is the File Extension .Tar?

    File archiving is the term given to duplicating or grouping uncommonly accessed documents together in order to preserve them for future use,...

  • How to Unzip TAR Files in Unix

    TAR is a command line utility used most often in Unix variants including Unix systems, BSD and Linux. The TAR utility provides...

  • How to Extract TAR Files

    TAR files are directories that hold multiple data files. Though most TAR files are created on Unix-based computers, they can be extracted...

  • How to Read TAR Files

    Comments. You May Also Like. How to Open a Tar File. In UNIX and LINUX, TAR refers to the legacy term for...

  • How to Unzip a ZIP File in Unix

    The ZIP file format is a data compression and archive format. A ZIP file contains one or more files that have been...

  • How to Create a Tar File

    The tar (tape archive) command is a way of combining multiple files into a single file, or archive, on the Linux or...

  • How to Open a Tar File

    In UNIX and LINUX, TAR refers to the legacy term for tape archiving, or the storage of an entire file system on...

  • How to Create Tar Files on Windows

    Tar files are typically used in Linux and Unix systems. They are the equivalent of Zip files for Windows systems. A Tar...

  • How to Extract TAR Files in Linux

    In the Linux, a .TAR file is the equivalent of a .ZIP file in Windows. It is an archived file containing multiple...

  • How to Unzip a Tar Z File

    Tar Z files are Unix-based compressed archives that contain batches of files or an entire application. These files are commonly compressed using...

  • How to Use the Tar Command

    The most common way to deliver a batch of files from a Linux system is by using the "tar" command. When you...

  • How to Unzip TAR Files in Windows

    TAR files are much like RAR or ZIP files. They are compressed archives containing a group of related files or an entire...

  • How to Unzip a File in Unix

    There are three types of data compression formats commonly used in UNIX: .zip, .tar and .gz. The ZIP file format is most...

  • How to Extract Tar Files in Terminal

    Files with the ".tar" extension, sometimes called "tarballs," are a type of compressed archive, which means they contain several different files that...

  • How to Create a File in Unix

    Creating a file is very easy to do in Unix. Many Unix users make programs that create zero length files on the...

  • How to Backup an Image in a SCO Unix System

    SCO Unix is a closed source Unix variant owned and maintained by the SCO Group. The default installation includes a variety of...

  • How to Install Software in Unix

    Traditionally, software applications for Unix is packaged as .tar files of source code. This code must be converted into a binary format...

  • How to Unzip a Z File in Unix

    "Z" files consist of any number of files that have been compressed together into one file using the Unix/Linux "compress" utility. Compressing...

Related Ads

Featured