Michelle Vossen

Back to overview

Commands

This is an ongoing list of commands that I’m probably going to use a lot, as an overview for easy reference.

Git commands

Command Description Example
cd Change directory cd C:\Users\mvoss\Pictures\temp\
pwd Get current directory  
ls List all files and folders in current directory  
copy, cp Copies an item from one location to another cp *.jpg* -Destination "~/Documents\Gitlab\fabacademy\michelle-vossen\assets\images\weeks\week1"
mkdir Make a new directory mkdir week2

ImgMagick

What it does Command
adjust extension magick convert img.jpg img.png
resize magick mogrify -resize “800>” .jpg
quality magick mogrify -quality 75% .jpg
convert all images from one extension to another (png to jpg) magick mogrify -format jpg .png

ffmpeg

What it does Command
Convert mov to mp4 ffmpeg -i input.mov -q:v 0 output.mp4
Compress mp4 (you can change the 500k to another number and the scale as well to lower or increase the size) ffmpeg -i input.mp4 -vcodec libx264 -b:v 500k -vf scale=-2:500 -an output.mp4
Speed up mp4 (lower number is faster; it drops frames so that’s good for compression) ffmpeg -i input.mp4 -filter:v “setpts=0.06*PTS” output.mp4
Rotate video clockwise ffmpeg -i in.mov -vf “transpose=1” out.mov
Powershell command for batch ffmpeg (you have to be in the folder that has the videos that have to be compressed) Get-ChildItem *.mp4 -recurse | % { ffmpeg -i $_.FullName -vcodec libx264 -b:v 500k -vf scale=-2:500 -an ("C:\Users\mvoss\Pictures\temp\batch" + "\" +$_.Name) }

Powershell

What it does Command  
Renaming all files in a folder (note: this only works if the file extensions are jpg, change accordingly; there are more elegant ways to do it but this was my rush solution; can work nicely after changing all extensions to jpg with ImgMagick anyway) [ref]$i = 1; gci -file Rename-Item -NewName {‘{0:D4}.jpg’ -f $i.Value++, $_}
Giving a preview of what a command is going to do -whatif  

esptool

esptool --port com25 --baud 115200 --chip esp32c3 read_mac