Skip to content

Instantly share code, notes, and snippets.

@myfavouritekk
Last active August 29, 2015 14:04
Show Gist options
  • Save myfavouritekk/7b5b5c6409fd263e54e8 to your computer and use it in GitHub Desktop.
Save myfavouritekk/7b5b5c6409fd263e54e8 to your computer and use it in GitHub Desktop.
Linux/Unix: Compress and copy
# Use tar to direct output to standard output "-" and use gzip to compress
tar -cf - <source_file> | gzip -1 > <destination_file>
# Same effect, be sure to put <destination_file> directly behind -f option
tar -czf <destination_file> <source_file>
# Untar
tar -xzf <tar_file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment