Timeline for Extract multiple .tar.gz files with a single tar call
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 20, 2022 at 13:29 | comment | added | scy won't contribute anymore | And, by the way, -f - can probably be omitted altogether, because without -f, tar will read from standard input (or write to standard output, depending on the operation) anyway. So instead of tar -xvf - -i you could also write tar -xvif - and even tar -xvi. | |
| Dec 20, 2022 at 13:26 | comment | added | scy won't contribute anymore | @HamsterWithPitchfork: Sounds to me like you’ve typed tar -xvf -i instead of tar -xvf - -i. That’s because -f requires a filename to follow. The special filename - means “standard input”, i.e. whatever is being piped into tar. If you omit that dash, tar will instead interpret the following -i as the file name. That file doesn’t exist, which is why it’s telling you -i: Cannot open: No such file or directory. | |
| Feb 22, 2022 at 18:49 | comment | added | HamsterWithPitchfork | This doesn't work on latest ubuntu: tar (child): -i: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now | |
| Jan 17, 2021 at 7:35 | comment | added | Baruch | to call this syntax easy is a stretch. tar -xf *.tar would be easy (and intuitive) | |
| Dec 29, 2020 at 9:23 | comment | added | Hossein | @DanielLe Thanks a lot really appreciate it | |
| Dec 29, 2020 at 8:44 | comment | added | Daniel Le | @Rika, tar -f - reads from stdin, hence one needs to pipe the content of the archives, not their names. That's why ls wouldn't work. | |
| Feb 2, 2020 at 3:55 | comment | added | Hossein | @polynomial: is there any reason, why we cant use ls instead of cat? wouldnt that work as well? | |
| Dec 6, 2017 at 13:18 | comment | added | Ferroao | <For tgz> cat *.tgz | tar -xzvf - -i -C /destination/ <or> for file in *.tgz; do tar -xzvf $file -C /destination/; done | |
| Sep 1, 2011 at 9:40 | vote | accept | scy won't contribute anymore | ||
| Sep 1, 2011 at 9:40 | comment | added | scy won't contribute anymore | This seemed to work for me. Exact command I used was: cat *.tar.bz2 | tar -ixjv. Thanks! | |
| Aug 31, 2011 at 18:47 | history | answered | polynomial | CC BY-SA 3.0 |