On , I learnt ...
About the MacOS screencapture
utility
It’s what MacOS uses for its shortcuts but can be called from the command-line:
screencapture
It has lots of interesting options – see man screencapture
.