Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Take a Screenshot in Linux

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To take a screenshot in Linux, press PrtSc to capture the entire screen, Shift+PrtSc to select an area, or Alt+PrtSc for the active window. The image is saved to your Pictures folder by default. Most desktop environments include a screenshot tool, and you can also use the gnome-screenshot or scrot commands in the terminal. This guide covers the built-in methods for GNOME, KDE, and Xfce, plus command-line options.

What You'll Need

  • A Linux desktop environment (GNOME, KDE Plasma, Xfce, or similar) with a graphical session.
  • A keyboard with a PrtSc (Print Screen) key. If your keyboard lacks one, you can use the on-screen keyboard or remap a key.
  • Optional: a terminal emulator for command-line methods.

Step-by-Step

  1. Take a full-screen screenshot: Press the PrtSc key. The screen will flash briefly, and the screenshot will be saved to ~/Pictures (or ~/Screenshots on some systems) with a timestamped filename.
  2. Capture a specific area: Press Shift+PrtSc. Your cursor will change to a crosshair. Click and drag to select the area you want, then release the mouse button. The selection is saved immediately.
  3. Capture the active window: Click on the window you want to capture to make it active, then press Alt+PrtSc. Only that window is captured.
  4. Copy to clipboard instead of saving: If you want to paste the screenshot directly into an image editor or document, hold Ctrl while pressing the shortcut (e.g., Ctrl+PrtSc for full screen, Ctrl+Shift+PrtSc for area). The image is placed on the clipboard.
  5. Use the GNOME Screenshot GUI: Press the Super (Windows) key and type "Screenshot" to open the Screenshot app. Choose between Selection, Screen, or Window, set a delay if needed, and click the camera icon to capture.
  6. Use the KDE Spectacle tool: In KDE Plasma, press PrtSc to open Spectacle. You can select the region, window, or full screen, annotate, and save or copy the image.
  7. Use the Xfce Screenshot app: In Xfce, press PrtSc to open the screenshot dialog. Choose the region, window, or full screen, and set a delay if needed.
  8. Use the command line with gnome-screenshot: Open a terminal and type gnome-screenshot for the GUI, or gnome-screenshot -f /path/to/file.png to save directly. Use -a for area selection, -w for window, and -d 5 for a 5-second delay.
  9. Use scrot for more control: Install scrot with your package manager (e.g., sudo apt install scrot on Debian/Ubuntu). Then run scrot /path/to/file.png for full screen, scrot -s for area selection, and scrot -u for the focused window.

Common Mistakes

  • Pressing PrtSc and nothing happens: Some window managers or minimal setups don't bind the key by default. Try using the GUI tool or the command line instead.
  • Screenshots not saving: If the Pictures folder doesn't exist, the screenshot may fail silently. Create it with mkdir -p ~/Pictures.
  • Area selection not working: If you're on Wayland, some tools may not support area selection. Use the built-in GNOME screenshot tool or switch to Xorg if needed.
  • Capturing the wrong window: With Alt+PrtSc, ensure the target window is focused (click on it) before pressing the shortcut.

Tips

  • Use a delay if you need to open a menu or hover over something before capturing: gnome-screenshot -d 3 waits 3 seconds.
  • For quick sharing, copy to clipboard (Ctrl+PrtSc) and paste directly into chat apps or email.
  • On Wayland, the built-in tools are more reliable than third-party ones that rely on X11.
  • If you need to capture a scrolling webpage, use a browser extension or a dedicated tool like Flameshot (install via your package manager).
  • Set a custom shortcut in your desktop settings to launch your favorite screenshot tool.

Troubleshooting

If the screenshot does not appear where expected:

  1. Check your home directory for a Pictures or Screenshots folder. If it's missing, create it and try again.
  2. Look for a notification or a flash on the screen. Some tools show a preview or a notification with the save location.
  3. If using a custom tool, check its settings to see where it saves files.

If the PrtSc key does nothing:

  1. Try the GUI tool: search for "Screenshot" in your app menu.
  2. Open a terminal and run gnome-screenshot (or spectacle on KDE, xfce4-screenshooter on Xfce) to see if the tool launches.
  3. If the terminal command fails, install the tool: sudo apt install gnome-screenshot (or your distro's equivalent).
  4. If the key is not mapped, go to Settings > Keyboard > Custom Shortcuts and add a new shortcut that runs the command.

If the screenshot is black or blank:

  1. This often happens with hardware acceleration or on Wayland with certain drivers. Try using the built-in tool instead of a third-party one.
  2. Switch to Xorg by logging out and choosing the session type at login, if available.

If you get a "Failed to capture" error:

  1. Make sure you have write permission to the target directory.
  2. Try saving to a different location, e.g., gnome-screenshot -f /tmp/test.png.

Frequently Asked Questions

Where are screenshots saved by default?

Most desktop environments save to ~/Pictures or ~/Screenshots. You can change this in the screenshot tool's settings.

Can I take a screenshot of a specific monitor in a multi-monitor setup?

Yes, with the GNOME Screenshot GUI you can select the monitor from the "Screen" dropdown. With gnome-screenshot, use the --display option or select the area manually.

How do I take a screenshot of the login screen?

This is not possible from within the session. You can take a photo of the screen or use a virtual machine with a screenshot tool.

What's the difference between PrtSc and Shift+PrtSc?

PrtSc captures the whole screen, while Shift+PrtSc lets you select a rectangular area.

How do I take a screenshot from the terminal?

Use gnome-screenshot or scrot. For example, scrot myimage.png saves a full-screen screenshot to the current directory.

Can I take a screenshot without a PrtSc key?

Yes, use the GUI screenshot app from your application menu, or set a custom keyboard shortcut in your desktop settings.