Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here, it 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 .

share|improve this question

1 Answer 1

cat myfile.tgz | ssh user@host "tar xzf - -C /some/dir"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.