[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1253
  • Last Modified:

Screen shot in unix

In Windows, the [PrintScreen] key gets a screen shot (the current image on the screen).
How do you do the same in Unix?

I'd be interested especially in an answer which covers most flavours of Unix.


1 Solution
Unix doesn't have anything like the "print screen" key (at least I've never seen one that did). Solaris' CDE has something close that allows you to mark text and drag it onto the printer icon on the task bar. Every X implementation on Unix has a way to generate a snapshot of the screen or any portion of the visisble screen. The utilities for doing so are platform dependent, check the docs for your platform to see how it does it.
Vin32Author Commented:
Sorry, jlevie, I just want other inputs... if I do find your answer correct later, you can have the points.
Vin32Author Commented:
I am woking primarily on SCO OpenServer 5.0.5, by  the way.
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Assuming you're running X Windows, you can use the xwd utility to dump all or part of the screen.  You can then use xpr  to transform the resulting XBM into a printable format such as PostScript.

Something like this:

  xwd -root | xpr -device ps -height 10 -width 7.5 -top .5 -left .5 | lp

See the xwd, xpr, and lp man pages for full details.
If you have posibility to run the unix thru a PC with "exeed" or something similar, then you can take the screenshots in the PC instead.
That's what I do.
(don't know any method in unix directly)
Vin32Author Commented:

Thanx, chris_calabrese! That does work, but my application was a command line utility launching forms with some enterable fields. I wanted a screen shot of it in command line mode, not in X-Windows.
The screen shots are needed for making the users' manual.
I give you the points because it nevertheless increased my knowledge.

And jlevie, this was much more specific than your comment.

But tryno also has a valid point there which I had already thought of. The problem there is this : you have to edit the screenshot images to remove the extra window (of "exceed" or other such). That is quite a bit of work when you consider many screens.

Anyway, thanx once again to all of you!
Instead of doing 'xwd -root', you can do 'xwd', which then lets you click the mouse on an individual window to dump.
Vin32Author Commented:
Thanks, but i've already explored the options in the man pages.

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now