Here’s a rolling post on Terminal utilities I find particularly useful and which you could as well. For the moment I won’t go too in depth on what everything is, this is more for quick reference. I’ve linked the original sites they were from if you want to see the source

Ffmpeg commands

Add italian subtitles to MKV file

-i file.mkv -sub_charenc CP1252 -i -map 0:v -map 0:a -c copy -map 1 -c:s:0 srt -metadata:s:s:0 language=ita output.mkv

Convert from one file type to other

ffmpeg -i input.mp4 output.mkv

convert from webm to mp4 quickly

ffmpeg -i video.webm -preset veryfast video.mp4

Extract audio from video

Doesn’t work/needs to be fixed

ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac

-vn is no video.
-acodec copy says use the same audio stream that’s already in there.

Batch convert .mkv files to mp4 files

for f in *.mkv;do ffmpeg -i “$f” -c copy “${f%mkv}mp4”;done


Batch scale images

Place all the images you want to scale in a directory and navigate to that location via command line. Then enter:

mogrify -resize 960×528 *.png

This command resizes all of the .png files in your directory to a size of 960 pixels by 528 pixels. Perhaps the height isn’t as important as the width. You can simply enter:

mogrify -resize 960 *.png

This will scale all of your images to a width of 960 pixels, the height will be scaled accordingly, preserving the aspect ratio. Perhaps you have a height and width you are aiming for, but want to preserve the aspect ratio. You can enter:

mogrify -resize 960×528! *.png

Cat commands

Merge CSV Excel files

cd into directory
cat *.csv >combined.csv”