The command below extracts the specified file in a remote machine:
tar -xzOf file.tar.gz file_you_want_to_extract | ssh user@host 'cat > /path/to/destination_file'
My requirement is that I want to extract all the files in to the remote machine. How can i achieve this ?
tar -xzOf file.tar.gz | ssh user@host 'cat > /path_dir'
All the files in file.tar.gz should be extracted in the remote host in /path_dir .