I have a tar.gz file that has multiple dirs and files inside. I need to copy and extract a specific dir from it to a remote host.
I know how to do it with a single file, but have trouble with multiple files in a single command:
tar zxOf /mnt/debug.tar.gz libr.so | ssh $MY_IP 'cat > /local/libr.so'
I currently workaround by extracting the whole dir locally, then use scp to copy:
tar -zxf /mnt/debug.tar.gz -C utils/foo --strip-components=1 tools/