Skip Navigation
Site HomeSearch

On-Line Reference:
RedHat Linux Unleashed

Did this help?
... or
Donate at PayPal®...

 
Tux the Pengin

OK, here's a freebie: A simulation of the old text-based Star Trek game we used to play on HP 2100's using a Teletype ASR-33 as a console: StarTrek Game

Capturing Screen Shots

(For those of you expecting ACTUAL screenshots...)

There are many ways to capture a Linux screen. Four of them are:

  • xwd- quick dump from the command line,
  • xv- older utility for grabbing and converting color images, and
  • import- another quick dump from the command line,
  • the GIMP
  • the Gnome ScreenShooter

For more details on the utilities, also review their associated Linux "man" pages. For example, issuing the command "$ man ppmtojpeg" shows the Linux "manual" for the ppmtojpeg utility. Often, additional and similar utilities are listed at the end of the manual.

Using XWD

  1. At the command line, type
    $ xwd >mydump.xwd
    you get a crosshair, which, when you click it in a window, captures the contents of the window, or if clicked on the root window (desktop), captures the whole screen.
  2. Now type
    $ xwud -in mydump.xwd
    to view the image, or
  3. Type
    $ convert mydump.xwd mydump.tiff
    to change the screen dump to a better format for publishing.
    See also the man pages for convert and read up on the features of ImageMagick, and also try the GIMP.
  4. You could also combine functions using the pipe symbol:
    $ xwd | xwdtopnm | ppmtojpeg >dump.jpeg

Using XV

This is the one to use in older distros if you wish to capture a window as it looks when it is the active one - title bar highlighted, complete with borders. Although not included in later distros, you can get it here: http://www.trilon.com/xv/xv.html.

  1. At the command line, type
    $ xv
  2. Click the GRAB button, and when the dialog box opens, enter a delay of 5 to 10 seconds and check the "Hide xv windows" checkbox.
  3. Click "Grab".
  4. Activate the window you wish to capture by clicking it, then after the delay time, click in the window again to grab it. Click on the root window (desktop) to capture the entire screen.
  5. The screen will flicker, as the captured image is displayed, and the XV windows will reappear.
  6. Click "Save". Enter a filename for the image and click "OK".
  7. Click "Quit".

You can now open the image in GIMP and edit it as desired.

Here is an old shot of my LinuxPPC screen (82Kb) utilizing a wood-themed early version of KDE. There is a root-tail on /var/log/messages running in the upper left.

Using Import

I showed you the xwd method first, because it is a legacy function from older distributions and Unix.
This is even easier:

  1. At the command line, type
    $ import -pause 10 -window root screenshot.jpeg
    to capture the whole screen after a 10-second delay (pause gives you time to do stuff like select the active window, change workspaces, show root menus, etc).
  2. Or type
    $ import dump.jpeg
    to save whatever window you click on (including the whole screen if you click on the background) as a jpeg file named "dump.jpeg". Change the file extension to change the type of file saved. Check the man pages for file types handled by import.

    You can use "cmd-tab" to switch windows, hiding the terminal.

    The beauty of import is that it is scriptable, and can be executed from programs or configurable menus as used in WindoMaker, Fvwm and other minimalist window managers.

Using The GIMP

  1. Launch GIMP1.2 or newer. (I am still a Mac mouser, so I select "GIMP" from my Fvwm pop-up menu, but you can type gimp at the command line) and choose "Acquire>Screenshot..." from the GIMP toolbox "File" menu.
  2. Once you have a screen capture window, save it as a gif by right-clicking in the image to get a contextual menu at the pointer location.
  3. Name the image file with a ".jpg" extension, and GIMP will save it as a jpg. To save as other types, use GIMP menu commands to alter the file type before saving.

Using ScreenShooter

  1. In newer distros until Redhat 8 and 9, in which it is absent, the Gnome desktop environment offers a toolbar applet called ScreenShooter. To have it handy in your toolbar, press the "foot" menu and choose "Applets>Utility>ScreenShooter. You can position it where you want it in the bar by right-clicking to get a menu and choosing "Move".
  2. ScreenShooter has two panes; the left one captures a window you subsequently click on, the right captures the entire screen. The left one also captures an area if you click and drag the mouse across the part of the screen to grab.
  3. Images are named with a datestamp automatically and show up in your /home/user directory by default.

Here are some ACTUAL Linux screenshots:

Print plain