0

I am in the directory where the file.tar.gz file is located. I want to ignore umask by using the -p (--preserve) option. But I am unable to untar it with -p flag. What may be the reason for it?

  • tar -xvfp file.tar.gz # does not work
  • tar -xvf file.tar.gz # when I remove p it works
$ ls *file.tar.gz
file.tar.gz

$ tar -xvfp file.tar.gz
tar: p: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

$ tar -xvf file.tar.gz
file.txt

2 Answers 2

4

tar interprets the next argument after -f as the file name of the tar file.

Put the p before the f:

tar -xvpf file.tar.gz
2

Try separating -p from the -f command, as

tar -p -xvf file.tar.gz

You must log in to answer this question.

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