Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To save a full screenshot from Bash, run scrot "$HOME/Pictures/screenshot.png". For a region you choose with the mouse, use scrot --select "$HOME/Pictures/region.png". Scrot is a command-line screen-capture utility that uses imlib2; the exact options available depend on the version installed on your system.

Install Scrot and check your version

Scrot must be installed before Bash can run it. Installation commands vary by Linux distribution, and there is no single command that works across them all. Use your distribution’s package manager to install the package named scrot, then check that the shell can find it:

command -v scrot
scrot --help
man scrot

command -v prints the executable path if Scrot is available. If it prints nothing, the command is not on your current PATH or Scrot is not installed. The installed man scrot page is the best guide to supported flags on that machine: option spellings and availability differ between releases. For context, Ubuntu Jammy’s manual identifies its package version as 1.7-1, while Debian testing’s manual documents a newer option set. Those are release-specific references, not a claim about the version on your computer: Ubuntu Jammy scrot manual and Debian testing scrot manual.

Save a full-screen screenshot

Pass the destination filename to Scrot as its positional output argument:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
scrot "$HOME/Pictures/screenshot.png"

If the capture succeeds, Scrot saves the image at that path. The destination directory must already exist, and your user must have permission to write there. Quoting the path protects spaces and shell-special characters; it also makes a path based on $HOME safe to use.

For example, to save a capture in a directory named Project Screenshots under your home folder:

scrot "$HOME/Project Screenshots/landing page.png"

The command records the display rather than a browser page specifically. Make sure the screen shows the content you intend to capture before invoking it.

Choose a region, window, or rectangle

Pick the capture mode based on whether you want to choose the target interactively or already know its coordinates or window identifier. The option set can vary by installed version; confirm the relevant flag in man scrot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Select an area or window with the mouse

Use --select to make an interactive selection and save the result:

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
scrot --select "$HOME/Pictures/region.png"

When the selection interface appears, mark the area or window you want to capture. If your installed manual describes different selection behavior, follow that version’s instructions.

Capture a fixed rectangle

For a repeatable crop, the documented --autoselect form takes coordinates and dimensions in the order x,y,width,height:

scrot --autoselect 100,100,640,480 "$HOME/Pictures/area.png"

This requests a rectangle whose upper-left position is 100,100 and whose size is 640 by 480 pixels. The example values are coordinates, not a universal location: the result depends on the display layout and the coordinate system used by the active session. Check your local manual if the flag is absent or the crop is not where expected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Capture a window or the focused target

The current Debian testing manual documents window and focused-capture options. The exact flag and whether you need a window ID depend on the installed Scrot version, so consult its man scrot page rather than copying a flag from a different release. The practical choice is between selecting the window interactively and identifying it explicitly when you need a repeatable script.

Add a delay or countdown

Use --delay when you need time to arrange the screen before Scrot captures it:

Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*
scrot --delay 3 "$HOME/Pictures/shot.png"

This asks Scrot to wait three seconds before capturing. The manual also documents a count option that can be combined with the delay to show a countdown. Because exact spelling and behavior can be version-specific, verify the count option in the installed manual before scripting around it.

Choose an image format and filename

A filename extension can select the image format. For example, use .jpg for a JPEG image, or specify a format option such as --format png where supported. The current Debian manual lists JPG, PNG, GIF, and other formats; Ubuntu Jammy’s manual describes format selection and fallback behavior. If neither the name nor an explicit option selects a format, the Debian manual documents PNG as the fallback. See the Debian testing manual and Ubuntu Jammy manual for their respective versions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Examples:

scrot "$HOME/Pictures/screenshot.jpg"
scrot --format png "$HOME/Pictures/screenshot-image"

In the second example, the explicit format is intended to choose PNG even though the filename has no extension. Confirm the accepted format names and extension behavior in your local manual; do not assume all builds support every format listed by another distribution.

Use Scrot in a Bash script

Scrot can be called like any other command in a Bash script. Use quoted paths, create the destination directory first if needed, and stop the script if the capture command returns an error:

#!/usr/bin/env bash
set -euo pipefail

out_dir="$HOME/Pictures"
mkdir -p "$out_dir"
scrot "$out_dir/screenshot.png"
printf 'Saved screenshot to %sn' "$out_dir/screenshot.png"

Save the file, make it executable with chmod +x capture.sh, and run it with ./capture.sh. The script creates the output directory if it does not exist. It does not prove the screenshot contains the intended content; check the resulting file if the workflow is unattended.

Rank #4
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use

Run a command after saving

The documented --exec option runs a command on the saved image. For example:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
scrot --exec 'mv "$f" "$HOME/Pictures/"'

Special strings such as $f are interpreted according to Scrot’s execution-option behavior. Check the installed manual for the exact substitution rules before relying on a particular variable or embedding this in a production script.

Or skip the browser setup

Scrot captures your local display. If the task is instead to capture a webpage by URL, ScreenshotNeo can return an image or PDF from one GET request. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Replace YOUR_API_KEY with your API key and the example URL with the page to capture. The API can return PNG, JPEG, WebP, or PDF; its many options include viewport and device settings, full-page captures, element selection, custom CSS or JavaScript, and wait conditions. Visit ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common Scrot problems

“scrot: command not found”

Scrot is missing or its executable is not on the shell’s PATH. Install the package for your distribution, open a new shell if needed, and check again with command -v scrot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The output file is missing

Confirm that the destination directory exists and is writable, and that the filename is quoted correctly. Run the command in the terminal to see any error message, then check the exit status immediately with echo $?. A nonzero status indicates the command did not complete successfully.

Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

A flag is rejected or behaves differently

Scrot versions and distribution builds do not all expose the same options. Check scrot --help and man scrot on the target machine; do not assume an option documented by Debian testing is available in an older release such as the Ubuntu Jammy package manual’s version 1.7-1.

The capture is blank or does not show the expected display

The Ubuntu Jammy and Debian testing manuals describe Scrot’s command-line capture features but do not establish compatibility with every desktop environment or display server. Verify that the intended display session is active, review the local manual, and consult your distribution’s documentation for display-session permissions and support. Do not infer Wayland compatibility from the Ubuntu Jammy and Debian testing manuals alone.

The selected rectangle is misplaced or clipped

Recheck the coordinate order and dimensions, then compare the rectangle with the active display’s layout. Coordinates that are valid for one arrangement may not identify the same portion of another. Use interactive selection with --select when a fixed rectangle is not reliable, if your installed version supports that option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reliability and workflow considerations

  • Use an absolute or home-relative quoted output path so the saved location does not depend on the script’s working directory.
  • For repeatable captures, standardize the display layout and use a delay when the screen needs time to settle.
  • For scripts that move, upload, or process the image after capture, confirm the actual output path and the local manual’s special-string rules before depending on --exec.
  • Scrot captures a screen image; it does not establish that a page has finished loading or that a particular web element is present. For browser-state automation, use a browser-specific workflow or a URL-based capture service rather than treating a screenshot command as a page-load check.

Frequently Asked Questions

What does the name Scrot stand for?

The Scrot manual expands it as “SCReenshOT.”

Can I use Scrot to make a PDF?

The Scrot documentation describes saving screenshots as image files and does not establish PDF output. Use an image workflow or a separate conversion tool if you need a PDF.

Does Scrot work on every Linux desktop or display server?

The Ubuntu Jammy and Debian testing manuals do not establish support for every desktop environment or display server. Check the documentation for your installed Scrot build and distribution.

Quick Recap

Bestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.34
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.