DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Forums
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS

OSXFAQ Daily Unix Tricks   back to index

Week 36 - tar balls (17 March 2003)

by Adrian Mayo - Senior Editor for Mac OS X Unix

Monday - creating and extracting tar balls

Just as Aladdin Systems' StuffIt allows one to 'stuff' many files into a single '.sit' file, the Unix 'tar' command allows one to create an archive (often called a tar ball). 'tar' was originally used to archive to magnetic tape (tape archiver), but now a days it is more often used to archive to a named file.

To archive the whole of the ~/Sites directory into a single file called sites.tar, use:

cd ~
tar cvf sites.tar Sites

The options 'cvf' do the following:

c - create a new archive
v - verbose, name each file as it is added to the archive
f - archive to a named file, in this case sites.tar

The original directory is untouched.

To decompress the archive use the command:

tar xvf sites.tar

This extracts the original files into a directory called 'Sites', which is created if it does not already exist.

The option 'x' says to extract from existing archive.


Discuss this trick in the Learning Center forum


If you want to learn more about Mac OS X Unix visit the Learning Center  click.

  • For beginners: the Mac OS X Unix Tutorial
  • For detailed information on specific topics: Mac OS X Advanced Unix
  • For answers to common problems: Mac OS X How To



Copyright © 2000-2008 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.