Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

tar can create the archive in different formats. GNU tar, ustar, pax, v7. What would be the best for long time archiving? Is there significant differencies in these formats?

I would use the best format for general backups, and I don't want that maybe I can extract the data, because format problems. (v7 is disappear from implementation for example)

share|improve this question
up vote 4 down vote accepted

The GNU tar manual actually has an entire section dedicated for tar archive formats. The formats ustar and pax are based on POSIX standards, and gnu is very widespread. I'd steer clear from the other ones.

My suggestion would be to choose pax, that is POSIX.1-2001. GNU tar is making it the default in the future and even old ustar implementations can decompress it. It's also the least restricting format.

You can create POSIX.1-2001 archives e.g. with GNU tar by specifying --format pax or with a separate pax archiver.

share|improve this answer

pax is POSIX compliant... That having been said, I only use tar, tar+gz and tar+bz2

share|improve this answer

tar.gz is the fairly standard one.

tar archives all the files into a single file, like .iso, but it doesn't compress those.

gzip (gz) will compress the tar files.

The *nix command line to perform this is:

tar -pczf name-of-new-archive.tar.gz /path/of/the/directory
share|improve this answer
tar -zcvf name-of-new-archive.tar.gz /path/of/the/directory – JeffG Mar 22 '11 at 21:46
for backup purposes (as noted in the Q), we generally use -p to enable permission retention. the -v you mentioned is optional, but is good for logging purposes in automated processes. – Hyppy Mar 22 '11 at 22:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.