When I use the -p option in tar (preserve permissions), do I need to use the option during both the creation AND extraction of the archive, or just ONE of them?

I'm unable to find a definitive answer to this question, and "man tar" doesn't make it clear either.

So, I wonder if you could tell me please, which of the following needs the "p":

$ tar cpf archive.tar source-files     # Create an archive.
$ tar xpf archive.tar                  # Extract the archive.

I'm interested to know if only one of the commands requires the "p", rather than just use a blanket solution of using "p" in both.

  • 1
    The manpage makes it pretty clear that it's for extraction. Mar 4, 2017 at 21:00

1 Answer 1


tar stores the permissions by default when creating an archive, so p isn't necessary with c. It is necessary with x, unless you're running as root; otherwise the current umask is applied instead of the stored permissions. See the documentation:


Set modes of extracted archive members to those recorded in the archive, instead of current umask settings. Use in conjunction with --extract (--get, -x).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .