How to make screenshot from command line

1
2
3
4
5
6
7
platform-edc $ screencapture -i ~/Desktop/$(date +%Y%m%d%H%M%S).png
libpng warning: zero length keyword
libpng warning: Empty language field in iTXt chunk
 
platform-edc $ screencapture  ~/Desktop/A$(date +%Y%m%d%H%M%S).png
libpng warning: zero length keyword
libpng warning: Empty language field in iTXt chunk

First one is “interactive” - Cmd-Shift-3 with selection tool, second is full screen