if you know relative filename of intermediate file, try tar -xf $1 -O path/to/file.tar.gz | tar xf - where > -O, --to-stdout > Extract files to standard output. 1. you might need `-z` flag in second tar 2. please note that `-` is synonym for stdin, maybe that what you meant (`tar -xf $1 | tar -xf xargs` (*) ) ? tar -xf $1 | tar -xf - (*) xargs is backquoted