跳到正文
更新 2019-04-12 文章 Linux

Linux 批量无损压缩图片

安装JPG和PNG压缩

yum install jpegoptim
yum install optipng

然后在需要压缩的目录下执行如下命令进行压缩jpg格式的图片

//压缩JPG
find . -name '*.jpg' | xargs jpegoptim --strip-all
//压缩PNG
find -type f -name "*.png" -exec optipng {} \;

参考