Any way to reboot a iDevice that is connected to a USB port via terminal (Mac terminal)?

idevicediagnostics is a Linux tool which can help here. It is also available for macOS according to these instructions.

Once installed you can use

idevicediagnostics restart

to restart your device.

To restart a specific device connected to a macbook that has more than one device connected to, use:

idevicediagnostics -u udidnumber restart

To install this third-party program, on the Terminal:

brew install libimobiledevice

Use:

idevicediagnostics restart