Get MAC's serial no via terminal

SSH into the mac,

> system_profiler SPHardwareDataType | grep “Serial”

this command should get u the serial no. (works on Mojave)