Last active
January 27, 2017 22:18
-
-
Save nikolazic/3d47d795cb9dad674f10 to your computer and use it in GitHub Desktop.
Recompress all GZIP files into LZMA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -name '*.gz' -type f | while read filename; do gzip -cd "$filename" | lzma > "$filename".lzma && rename s/\.gz// *.gz.lzma; done | |
| -OR- | |
| find . -name '*.gz' -type f | while read filename; do gzip -cd "$filename" | lzma > "$filename".lzma && rename .gz.lzma .lzma; done | |
| WITH DELETE | |
| find . -type f -name "*.gz" | while read line ; do echo $line; gunzip --to-stdout "$line" | xz > "$(echo $line | sed 's/gz$/xz/g')"; rm -f "$line"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment