Unable to run tar command - invalid option -- '▒'
Solution 1
Thanks to Paul R I have an answer. No idea how to mark his comment as the answer though so here it is:
Some older versions of tar don't like the
-
at the start of the commands - trytar cvpfz ....
– Paul R 5 mins ago
Solution 2
Are you copy and pasting the command, instead of hand-typing it in terminal?
In my case, I was getting:
tar: invalid option -- '�'
I was pasting into terminal, the command from a raw text file, which I had copied from a tutorial:
tar –xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
I hand-typed the entire command:
tar -xvzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
and it worked. I suspect it was something like an extra space character or a -
or similar which was not working.
Angus
Updated on July 22, 2022Comments
-
Angus almost 2 years
I've run into a problem while running a tar script. I am getting an invalid option, as shown in the screenshots, that is stopping the script running. I don't get why however as the command worked outwith the script. Can anyone help me?
The script:
The error:
-
Paul R about 8 yearsSome older versions of
tar
don't like the-
at the start of the commands - trytar cvpfz ...
. -
Angus about 8 yearsThanks a lot. That resolved the issue.
-
-
Paul R about 8 yearsNo problem - glad it helped - have some rep... ;-)