Skip to content

Instantly share code, notes, and snippets.

@unakatsuo
Created September 16, 2011 04:16
Show Gist options
  • Save unakatsuo/1221187 to your computer and use it in GitHub Desktop.
Save unakatsuo/1221187 to your computer and use it in GitHub Desktop.
Onliner: keep sparse section after decompressing.
# When you extract the compressed file which might be sparse originally, the generated file will be non-sparse.
# Here is the oneliner that allows to keep sparse without creating temporary file.
zcat sparse.raw.gz | cp --sparse=always /dev/stdin sparse.raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment