I am trying to make a tar ball and its throwing the error,

persis1@takwa228-DEV $ tar -pcrvzf ALPHA.tar.gz https-ALPHA

tar: You may not specify more than one `-Acdtrux' or `--test-label' option

Try `tar --help' or `tar --usage' for more information.

As the message says, you can't combine c and r; the former means "create an archive", the latter "append to an archive", so they can't be used simultaneously.

You can simply do

tar cpvzf ALPHA.tar.gz https-ALPHA

Let me add that I ran into the same error message due to another cause. This one passed through for many months, and this morning suddenly told me

You may not specify more than one '-Acdtrux' or '--test-label' option

upon running

tar cfvz backup-logs.$(date +'%Y-%m-%d').tgz *.log

Reason was there was a file called -crontab.log, with a hyphen in front of the filename. Took me half an hour to figure that out. Removing the hyphen from the filename fixed that.

  • 1
    Preceding the filename glob with -- on the command line to signal the end of command line options would also have helped.
    – Kusalananda
    Oct 12 '20 at 14:18
  • That means the filename glob is resolved and then appended to the command line? Sounds weird.
    – Anse
    Feb 22 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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