How Do You Take a Screenshot on Linux?
Taking a screenshot is an essential skill for anyone using a computer, whether for work, study, or sharing moments from your screen. On Linux, a powerful and versatile operating system, capturing your screen can be just as straightforward as on other platforms—but it also offers a variety of tools and methods tailored to different needs. Whether you’re a casual user wanting to save a quick image or a developer needing precise control over your captures, understanding how to take a screenshot on Linux opens up a world of possibilities.
Linux’s open-source nature means there isn’t just one way to capture your screen; instead, you’ll find multiple options ranging from built-in shortcuts to specialized applications. This flexibility allows users to choose the method that best fits their workflow, whether it’s grabbing the entire desktop, a specific window, or a custom-selected area. Additionally, Linux’s diverse desktop environments each bring their own screenshot utilities, adding another layer of customization and convenience.
In the following sections, we’ll explore the various approaches to taking screenshots on Linux, highlighting both simple and advanced techniques. By the end, you’ll be equipped with the knowledge to quickly and efficiently capture your screen in any situation, enhancing your productivity and communication on this robust platform.
Using Command-Line Tools for Screenshots
Linux offers several powerful command-line utilities to capture screenshots, providing flexibility for scripting and automation beyond graphical tools. These tools are particularly useful in server environments or minimal installations without a desktop environment.
One of the most commonly used utilities is `scrot`. It is lightweight, easy to use, and supports various options for delayed captures, filename patterns, and image quality.
To take a screenshot with `scrot`, simply run:
“`bash
scrot
“`
This captures the entire screen and saves it in the current directory with a timestamped filename.
You can specify a filename:
“`bash
scrot my_screenshot.png
“`
Or set a delay before capturing:
“`bash
scrot -d 5 delayed_screenshot.png
“`
Here, `-d 5` waits 5 seconds before capturing, allowing you to prepare the screen.
Another versatile tool is `import`, part of the ImageMagick suite. It allows capturing specific windows or screen regions interactively or by coordinates.
Example to capture a selected area interactively:
“`bash
import screenshot.png
“`
The cursor changes to a crosshair, letting you click and drag over the desired region.
For capturing a specific window, use:
“`bash
import -window root screenshot.png
“`
This captures the entire desktop (`root` window).
`gnome-screenshot` is a graphical utility but can also be invoked from the command line with options for capturing the entire screen, a window, or a selected area.
Common options include:
- `-w` to capture the current window
- `-a` to capture an area selected by the user
- `-d` to set a delay in seconds
Example command capturing a window after a 3-second delay:
“`bash
gnome-screenshot -w -d 3
“`
| Command | Description | Example Usage |
|---|---|---|
| scrot | Simple screenshot tool supporting delay and filename options. | scrot -d 5 mypic.png |
| import | Part of ImageMagick, captures screen, windows, or regions interactively or via window IDs. | import -window root full.png |
| gnome-screenshot | GNOME’s screenshot utility with CLI options for window, area, and delay captures. | gnome-screenshot -a |
| xfce4-screenshooter | XFCE’s screenshot tool, supports full screen, window, or region captures with command-line options. | xfce4-screenshooter -r |
Taking Screenshots in Different Desktop Environments
The method to capture screenshots can differ depending on the Linux desktop environment (DE) in use, as each DE typically provides its own screenshot tool integrated with the system.
GNOME
GNOME offers the `gnome-screenshot` tool, accessible via the `Print Screen` key or by launching the application directly. It supports capturing the whole screen, the current window, or a selected area. Keyboard shortcuts include:
- `Print Screen`: Capture entire screen
- `Alt + Print Screen`: Capture current active window
- `Shift + Print Screen`: Capture selected area
Screenshots are usually saved to the `Pictures` directory by default.
KDE Plasma
KDE uses the utility called `Spectacle`, which provides extensive options for capturing:
- Full screen
- Active window
- Rectangular region
- Delayed captures
`Spectacle` can be launched by pressing `Print Screen` or via the application menu. It also supports exporting screenshots directly to clipboard, files, or external applications.
XFCE
XFCE desktop environment includes `xfce4-screenshooter`. It can be triggered via the `Print Screen` key or command line. It supports:
- Full screen capture
- Window capture
- Region capture
- Delayed capture
It also allows copying the screenshot directly to the clipboard or saving it to disk.
MATE
MATE provides the `mate-screenshot` tool, which functions similarly to GNOME’s tool. It supports capturing the screen, a window, or an area, with optional delays.
Cinnamon
Cinnamon desktop uses a customized version of `gnome-screenshot` with additional features, accessible via keyboard shortcuts similar to GNOME.
| Desktop Environment | Default Screenshot Tool | Common Keyboard Shortcuts | Unique Features | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GNOME | gnome-screenshot |
Print Screen (full) Alt + Print Screen (window) Shift + Print Screen (area) |
Integrated with GNOME Shell, saves automatically | ||||||||||||||||||||||||||||||||
| KDE Plasma | Spectacle |
Print Screen (full) Alt + Print Screen (window) Shift + Print Screen (region) |
Rich options, export directly to clipboard or apps | ||||||||||||||||||||||||||||||||
| XFCE | xfce4-screenshooter |
| Shortcut | Action | Result |
|---|---|---|
| PrtScn | Capture full screen | Save to default folder |
| Alt + PrtScn | Capture active window | Save to default folder |
| Shift + PrtScn | Capture selected area | Save to default folder |
| Ctrl + PrtScn | Copy full screen | Copy to clipboard |
| Ctrl + Shift + PrtScn | Copy selected area | Copy to clipboard |
Note that some Linux distributions or customized environments may require enabling or configuring these shortcuts via system settings.
Using Command Line Tools to Capture Screenshots
Command line utilities offer powerful and flexible options for taking screenshots on Linux, especially useful for scripting and remote sessions.
Scrot
scrot is a lightweight command-line screenshot tool available in most Linux repositories.
- Install Scrot:
sudo apt install scrot(Debian/Ubuntu) orsudo dnf install scrot(Fedora). - Capture full screen:
scrot - Capture with delay:
scrot -d 5(waits 5 seconds before capturing) - Save with custom filename:
scrot 'screenshot_%Y-%m-%d_%H-%M-%S.png'
GNOME Screenshot
GNOME provides a command-line tool gnome-screenshot with various options.
- Capture entire screen:
gnome-screenshot - Capture active window:
gnome-screenshot -w - Capture selected area:
gnome-screenshot -a - Add delay:
gnome-screenshot -d 5
ImageMagick’s import
ImageMagick includes import, which can capture screenshots with advanced options.
- Capture entire screen:
import -window root screenshot.png - Capture selected window:
import screenshot.png(then click window) - Capture selected rectangle:
import -frame screenshot.png(select area)
This tool is valuable when you need image manipulation combined with screenshot capture.
Using Graphical Screenshot Applications
Graphical applications provide user-friendly interfaces with additional features such as annotation, delayed capture, and multiple output formats.
| Application | Desktop Environment | Key Features | Installation |
|---|---|---|---|
| Flameshot | All | Annotation tools, customizable shortcuts, upload to Imgur | sudo apt install flameshot |
| Kazam | All | Screen recording, screenshot, simple UI | sudo apt install kazam |
| Shutter | All | Editing, upload, delayed screenshots | sudo apt install shutter |
