many thanks
This could help other people:
To take a screenshot of the entire screen and save it to the desktop
screencapture -S ~/Desktop/screen.jpg
To take a picture of a window, and save it to the desktop
screencapture -iW ~/Desktop/screen.jpg
To take a screenshot of a section of the screen, and save it to the clipboard
screencapture -ic ~/Desktop/screen.jpg