Skip to content

Instantly share code, notes, and snippets.

@tomek-f
Forked from gielcobben/optimise-images-terminal.md
Last active January 11, 2024 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomek-f/59b7aa50f8d94eda213fa2860c16ea0b to your computer and use it in GitHub Desktop.
Save tomek-f/59b7aa50f8d94eda213fa2860c16ea0b to your computer and use it in GitHub Desktop.
File commands in the terminal

jpg

$ brew install jpegoptim
$ find . -name "*.jpg" -exec jpegoptim -m80 -o -p --strip-all {} \;

png

$ brew install optipng
$ find . -name "*.png" -exec optipng -o7 {} \;

mp4 to mp3

$ brew install ffmpeg
$ find . -name "*.mp4" -exec ffmpeg -i {} {}.mp3 \;

wav to mp3 (windows batch?)

$ for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment