I'm not very familiar with the terminal but I'm trying to join several splitted .tar.gz files like
- file1.tar.gz_aa
- file1.tar.gz_ab
- file2.tar.gz_aa
- file2.tar.gz_ab
within the same folder but I can only manage to get them all in the same file using:
for i in *.gz_; do cat ${i%/}* > "${i%/}".joined; done
I've tried "nesting" loops like so:
for i in *.gz_;do for y in ${i}.gz_* do cat ${i}.gz_${y} > ${i}.joined; done; done
but I get a syntax error near unexpected token `>'
Edit: I'm using Xubuntu for this (not sure if it matters) and my objective is to joind files in their original state (file1.tar.gz and file2.tar.gz).
I'm also trying to get just the filenames into an array using ${name%.tar.gz*}
but I'm so new to this I don't know yet how to remove duplicates and then "cat" them (sort -u hasn't worked)