Created
September 22, 2021 12:15
-
-
Save JohannesBuchner/f516c137c8634541f639bacec6e76d28 to your computer and use it in GitHub Desktop.
Better tar file compression by sorting similar files together
This file contains 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
# Compression can be improved when files with the same or similar content | |
# are next to each other in the file list. | |
# | |
# This command sorts by reversed filenames, which places files | |
# together by file extension, filename and path, in that order. | |
# identify all files | |
find mypath/ -type f | | |
rev | sort | rev | | |
tar --no-recursion --files-from=- -cvzf myarchive.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment