The terminal allows to capture screenshots after a specific time interval and you can also save a screenshot in some other file formats like JPG, TIFF, etc otherwise by default Mac saves screenshots in PNG format.
Follow the method written below to take a screenshot on Mac by using a command on the terminal.
How to Take Screen Shot Via Terminal On Mac
Click on Finder
Go to Applications > Utilities and then launch Terminal
Type following command in Terminal
screencapture -T 6 ~/Desktop/screenshot.jpg
where: T 6 = time interval in seconds, Desktop = location to save screenshot and screenshot.jpg = filename with extension
By default time interval is set to 5 seconds
To know further details about screencapture command type the following command in the terminal and hit Enter