Originally Posted by nyheat
Do you guys know if it's possible to do it the other way around as well?
I'd like to create a tar from the /dir/dir/* files, but it's recreating the /dir/dir directories within the tar, all I want is the files.
What is the exact command you tried? Anyway, I think there is no need of such an option, since once you've extracted files in the directory /stuff you can simply do
tar -C /stuff -zcvf new_archive.tar.gz *
If you want to do the same in one step, you need tar version >= 1.15.91 and use the --show-transformed-names option, piping the output of the tar command to another tar command, as in
tar --strip-components=2 --show-transformed-names -C /stuff -zxvf file.tar.gz dir1/dir2/ | tar -C /stuff -T - -zcvf new_archive.tar.gz
However, my advice is: keep it simple!