Could somebody give me a general idea about this command?

anneranch

Active Member
Credits
834
And I mean general idea.
I do not want references / links /u-tube or lengthy descriptions.
I can read man for tar etc.

It is used as part of installing / initializing for compiling a Pythton code and it fails.
Here are the errors :


tar (child): -C: Cannot open: No such file or directory
( OK I got it - no such directory.... the previous command should have buidl it ....)
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

(PS Nice error , making sure I get it ...twiice )



My limited understanding of this command it sets-up filtering of tar file .
Am I correct ?

If so - what is the purpose of filtering?


sudo tar xfj -C /usr/local gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2
 


JasKinasis

Well-Known Member
Credits
7,561
If so - what is the purpose of filtering?


sudo tar xfj -C /usr/local gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2

It doesn’t set up any kind of filtering as far as I can see.

x means extract
f means that you’re going to specify the file to extract
j means to use the .bz2 encoding
-C means change to the specified directory - in this case /usr/local has been specified

So basically it’s saying - "change directory to /usr/local and extract the archive gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 using the .bz2 format."
Or more succinctly - "extract the archive in /usr/local"

However, I think the problem with the command may be that the options need to be reordered slightly.

I think it’s complaining that it can’t find a file or directory called -C. Because after using the f option, tar expects to see a file-name.

So when using options like xfj, I always order them to put the f option last (xjf). Then specify the file to be created, or extracted. Then add any additional options/parameters/operands.

So the -C and its operand would be specified last.

So, perhaps try the following order:
Bash:
tar xjf gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2 -C /usr/local
Reordering the parameters like that should prevent tar misinterpreting them and should extract the archive to /usr/local.

Assuming that’s what you intended to do with it?!
 
Last edited:

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
17,696
Nice one Jas :)

... and @anneranch

And I mean general idea.
I do not want references / links /u-tube or lengthy descriptions.
I can read man for tar etc.
Please don't shout (the bold), it won't get you better attention.

Thank you

Chris Turner
wizardfromoz
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Credits
17,696
Moving this to Command Line, where it should be.

Wiz
 

anneranch

Active Member
Credits
834
Maybe I should have posted the whole set instructions.
However, my question has been answered and I appreciate that.
As far as "not shouting" - that is a overused , ridiculous cliche , but if that keeps you "in control" so be it.
Thanks for being so kind.

Thunder is good, thunder is impressive; but it is lightning that does the work.
Mark Twain
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Members online


Top