Decompress a tar file into a folder
#11
RE: Decompress a tar file into a folder
I know.
I’m just not a Unix or Linux “pro”. Since working with the O2s, I remembered a lot from the past when I used Linux at home but I normally don’t do that. And the man pages often lack of usage examples and are horrible to read - especially regarding tar.
The help that I googled (yes, I did that Smile) was obviously incorrect like in this thread above.
So it’s always nice to have someone to ask.

Jan
 O2plus 1600SW-on   O2 1600SW-on
O2+: R12k@400 Mhz - 1024 MB RAM - AV1 board - 1600SW adapter
O2 :  R10k@195 MHz - 320 MB RAM - AV1 board - 1600SW adapter
Jan
O2

Trade Count: (0)
Posts: 22
Threads: 3
Joined: May 2022
Location: Germany
Find Reply
07-29-2022, 06:29 PM
#12
RE: Decompress a tar file into a folder
tkzip is awesome and works perfectly well under IRIX:

https://wiki.tcl-lang.org/page/TkZip

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
07-30-2022, 01:30 AM
#13
RE: Decompress a tar file into a folder
Gunzip -f ./*.tar.gz
Tar -xvf ./*.tar

Will do all the tars in the current folder you are cd’d to

O2 O2O2
mamed
Octane

Trade Count: (0)
Posts: 112
Threads: 29
Joined: Jan 2021
Location: Canada
Find Reply
11-26-2022, 07:10 AM
#14
RE: Decompress a tar file into a folder
(11-26-2022, 07:10 AM)mamed Wrote:  Gunzip -f ./*.tar.gz
Tar -xvf ./*.tar

Will do all the tars in the current folder you are cd’d to

Are you sure about that tar command?  Usually only the file name immediately following the -f is the name of an archive file.  Everything else on the command line is assumed to be the name of a file inside that archive (causing tar to extract only the named files, rather than the entire archive).

E.g., if you have a.tar, b.tar, and c.tar then typically 'tar -xvf ./*.tar' would try to extract b.tar and c.tar from a.tar resulting in the error messages:
Code:
tar: ./b.tar: Not found in archive
tar: ./c.tar: Not found in archive
tar: Exiting with failure status due to previous errors

That's what you get from GNU tar and what I believe the standard behaviour is.  So I'd expect the same (maybe slightly different error messages) from IRIX tar, but I don't have any of my IRIX systems booted up right now to test.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
11-27-2022, 12:12 AM
#15
RE: Decompress a tar file into a folder
(11-27-2022, 12:12 AM)jpstewart Wrote:  
(11-26-2022, 07:10 AM)mamed Wrote:  Gunzip -f ./*.tar.gz
Tar -xvf ./*.tar

Will do all the tars in the current folder you are cd’d to

Are you sure about that tar command?  Usually only the file name immediately following the -f is the name of an archive file.  Everything else on the command line is assumed to be the name of a file inside that archive (causing tar to extract only the named files, rather than the entire archive).

E.g., if you have a.tar, b.tar, and c.tar then typically 'tar -xvf ./*.tar' would try to extract b.tar and c.tar from a.tar resulting in the error messages:
Code:
tar: ./b.tar: Not found in archive
tar: ./c.tar: Not found in archive
tar: Exiting with failure status due to previous errors

That's what you get from GNU tar and what I believe the standard behaviour is.  So I'd expect the same (maybe slightly different error messages) from IRIX tar, but I don't have any of my IRIX systems booted up right now to test.
Well just do tar -xvf *.tar than should work I have a sh file i use for batch gunzips and tar extractions so I don’t have to do that command everytime it gets old fast

O2 O2O2
mamed
Octane

Trade Count: (0)
Posts: 112
Threads: 29
Joined: Jan 2021
Location: Canada
Find Reply
11-27-2022, 12:53 AM
#16
RE: Decompress a tar file into a folder
(11-27-2022, 12:53 AM)mamed Wrote:  Well just do tar -xvf *.tar than should work

No, it won't.  As I said, the -f option to the tar command takes exactly one file name as an argument.  Any other filenames after that are handled differently.  (And remember that *.tar is expanded by the shell before the tar command sees it.  So if there's more than one file in the current directory that matches *.tar, tar is seeing a list of names.)  You can't extract multiple tar archives with a single tar command like that.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
11-27-2022, 12:27 PM
#17
RE: Decompress a tar file into a folder
This command line should just work fine:

Code:
cat *.tar | tar -xvf - -i

Onyx2 Rack Tezro Fuel Octane2 Octane2 Octane Indigo Indigo Indigo2 R10000/IMPACT Indy Indy Personaliris Visual Workstation 320 O2O2 + 1600SW
Noguri


Trade Count: (1)
Posts: 89
Threads: 12
Joined: Apr 2019
Location: Paris France
Find Reply
11-29-2022, 12:10 PM
#18
RE: Decompress a tar file into a folder
for i in `ls *.tar`; do tar -xvzf $i;done

there was a solution with xargs also but i cant remember.

Regards,
Joerg
Origin3k
O2

Trade Count: (0)
Posts: 8
Threads: 1
Joined: Sep 2015
Find Reply
11-30-2022, 07:21 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)