ISS HELP DESK > UNIX
Search Advanced Search
Search Tips

Using tar to make File Archives
Posted: 10: 37 AM, Monday, Feb 10, 2003
Last Updated: 7:00 PM, Tuesday, June 30, 2009

tar is a UNIX program for archiving data. While tar does not compress your data, it can be used to combine many files into a single file or tarball which can then be compressed or transferred to another machine for storage.

It is important to note that when you create a tarball, you will need enough free disk space available. For example, if you are archiving 5 MB of data files, you need another 5 MB available on your UNIX account to create a tarball. If you have insufficient disk space, you will receive an error.

RELATED LINKS

BEFORE YOU BEGIN

You must...
  • ...GW Faculty, Staff, or Student and have an account on a UNIX server, such as Acad or Research2. If you have not already done so, please visit the Account Center for instructions on creating an Acad account.
  • ...connected to this UNIX server by SSH. Please see shell.html for details.
  • ...have a basic working knowledge of UNIX.

Using Tar

Tar is the UNIX utility for combining several files into a single archive. The syntax for using Tar to create an archive is

tar cvf tarfile filename1 filename2

This will create a file called tarfile.tar that is an archive of the files filename1 and filename2. The extension used for Tar files is .tar.

Tar can also be used to archive the entire contents of a directory by typing

tar cvf tarfile -c directoryname

Tar does not automatically delete the original files, so to do that, you would type

rm filename

at the prompt.

To extract files from an archive, type

tar x tarfile

Full usage instructions for Tar can be obtained by typing man tarat the UNIX command prompt.


Rate This Document
Help us improve by rating the quality of this document:
lowhigh

1

2

3

4

5
Liked or disliked this document? If you tell us why, we'll keep up the good work or improve it! Your submissions are anonymous.


If you would like a response, please send an email to the ISS Suggestion Box at suggest@gwu.edu.

Support & Contact Info:
Help Desk: (202) 994-5530
EAS Help Desk: (202) 994-5530, option 4
System Status: (202) 994-5530, option 3
Support: ITHelp Request
Suggestions: suggest@gwu.edu

The George Washington University
Help Desk Hours:
Monday-Friday: 7:00AM - 10:00PM
44983 Knoll Square, Bldg II, Suite 351
Ashburn, VA 20147
ITS Fax: (202) 994-0101
Help Desk Fax: (703) 726-4111