LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Resolving tar: you must specify ‘-Acdtrux’, ‘- -delete’ or ‘- -test-lable ‘ options (https://www.linuxquestions.org/questions/linux-newbie-8/resolving-tar-you-must-specify-%91-acdtrux%92-%91-delete%92-or-%91-test-lable-%91-options-4175650781/)

Cworrior 03-24-2019 05:01 AM

Resolving tar: you must specify ‘-Acdtrux’, ‘- -delete’ or ‘- -test-lable ‘ options
 
Hi how do I resolve the following code line considering the subject
:/tmp# tar -C /usr/local/ .xvzf ./executable-v8-Linux-64bit.zip

pan64 03-24-2019 05:19 AM

you need to speficy tar options as -letter[s], so
Code:

#instead of:
tar -C /usr/local/ .xvzf ./executable-v8-Linux-64bit.zip
this would be probably better:
tar -C /usr/local/ -xvzf ./executable-v8-Linux-64bit.zip

by the way, what is that . (dot) before x ?

ehartman 03-24-2019 05:58 AM

Quote:

Originally Posted by Cworrior (Post 5977150)
Hi how do I resolve the following code line considering the subject
:/tmp# tar -C /usr/local/ .xvzf ./executable-v8-Linux-64bit.zip

A .zip file is NOT a tar archive, so cannot be unpacked BY it.
Try unzip instead.

pan64 03-24-2019 06:14 AM

tar -z means: Filter the archive through gzip(1). (see man page)

berndbausch 03-24-2019 06:28 AM

Quote:

Originally Posted by pan64 (Post 5977154)
by the way, what is that . (dot) before x ?

One possibility is copy and paste from a PDF or other non-text file, where the dash was not a simple ASCII dash.

By the way, tar is special since many options don't require a dash, e.g. tar tvf myarchive.tgz. This has been so since the early UNIX years.

And finally, I have no idea what the title of this question has to do with its content. Perhaps it's an error message?

pan64 03-24-2019 06:36 AM

Quote:

Originally Posted by berndbausch (Post 5977168)

And finally, I have no idea what the title of this question has to do with its content. Perhaps it's an error message?

yes, dash can be ignored only at the first argument, which is now -C. From this point tar has no idea what to do, that's why "you must specify ‘-Acdtrux’, ‘--delete’ or ‘--test-lable ‘ options".

ehartman 03-24-2019 11:26 AM

Quote:

Originally Posted by pan64 (Post 5977162)
tar -z means: Filter the archive through gzip(1). (see man page)

I know, but that only works when there's only a single file in the .zip as gzip cannot handle multiple output files (when expanding only one compressed file):
Quote:

Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method. This feature is only intended to help conversion of tar.zip files to the tar.gz format.

pan64 03-24-2019 11:51 AM

no, it is going to work in the reverse order: using tar -cz (creating a compressed archive) tar will first create the "result" tar file and will send thru gzip instead of saving that.
using tar -xzf will first gunzip the given file and the result will be untarred.


All times are GMT -5. The time now is 09:23 PM.