Add -mtime -2
to limit files by last modified time. -2
to means "in the last 2*24 hours from now".
Last active
May 6, 2020 19:03
-
-
Save jahed/73687eb0426b49d61576eeadb8b88c74 to your computer and use it in GitHub Desktop.
Batch image optimisation.
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
find . -type f -regex '.+\.jpg' -print0 | xargs -0 -L 1 -I % jpegtran -optimize -copy none -progressive -outfile '%' '%' | |
find . -type f -regex '.+\.png' -print0 | xargs -0 -L 1 -I % optipng -quiet -out '%' '%' |
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
find . -type f -regex '.+\.png' -print0 | xargs -0 -L 1 -I % pngquant --speed 1 --ext '.png' --force '%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment