To save your entire screen from Bash, run:
scrot "$HOME/Pictures/screenshot.png"
Scrot captures the display and writes an image at the path you provide. Use --select for an interactive area or window, --autoselect for fixed coordinates, and --delay when the screen needs time to change. Quote output paths so spaces and shell metacharacters cannot change the command’s meaning.
What scrot does
Scrot (SCReenshOT) is a command-line screen-capture utility that uses imlib2 to grab and save images. It is designed for still screenshots from a graphical desktop, not video recording. The positional filename is the simplest way to choose where the image is saved; the filename extension can select an image format.
Before relying on a flag in a script, check the version installed on the target machine:
scrot --help
man scrot
Distribution packages do not all expose exactly the same options. Ubuntu Jammy’s manual labels its package version 1.7-1, while Debian testing documents a newer option set. Treat the local help and manual as authoritative for your installation.
#1 Best Overall
- 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.
The basic Bash commands
Capture the full screen
scrot "$HOME/Pictures/screenshot.png"
This writes a PNG named screenshot.png in your Pictures directory. The command returns to the shell after saving. If the directory does not exist or is not writable, use an existing directory or create one first, then rerun the command.
Select a region or window interactively
scrot --select "$HOME/Pictures/region.png"
After you run it, select the area or window using the pointer. This is useful when the target changes size or position and you do not want to calculate coordinates. The saved file is created only after the selection is completed.
Capture a fixed rectangle
scrot --autoselect 100,100,640,480 "$HOME/Pictures/area.png"
The four values describe the rectangle as x coordinate, y coordinate, width, and height. Coordinates are measured against the display layout exposed to scrot. For repeatable automation, keep the desktop layout and scale settings consistent; a changed monitor arrangement can make the same rectangle cover a different area.
Capture a focused or specified window
Current Debian documentation includes options for focused-window and specified-window capture. Because option names and availability vary by package, find the exact spelling in man scrot or scrot --help on the machine where the script will run. Use the documented window mode rather than assuming a flag from another distribution.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsChoose the capture mode that matches the job
| Goal | Command pattern | When to use it |
|---|---|---|
| Whole display | scrot "path/file.png" |
Documentation, bug reports, and complete desktop state. |
| Interactive area or window | scrot --select "path/file.png" |
You decide the target with the pointer at capture time. |
| Repeatable rectangle | scrot --autoselect x,y,width,height "path/file.png" |
Scripts that always capture the same coordinates. |
| Delayed capture | scrot --delay 3 "path/file.png" |
You need time to open a menu, move a pointer, or arrange a window. |
| Post-save action | scrot --exec 'command' "path/file.png" |
Move, process, or upload the saved image immediately. |
Add a delay or countdown
Use a delay in seconds:
scrot --delay 3 "$HOME/Pictures/shot.png"
The display is captured after the delay, allowing you to prepare the screen. Scrot also documents a count option that can be combined with a delay for a countdown. Confirm the count flag’s spelling and output behavior in the installed manual before putting it in a shared script, because releases differ.
Rank #2
- 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
A delay is not a synchronization guarantee. If another process is still changing the screen when the timer expires, scrot captures whatever is visible at that instant. For deterministic automation, arrange the UI first, wait for the required state in your surrounding script, then invoke scrot.
Select an output format and filename safely
Use the extension
scrot "$HOME/Pictures/window.jpg"
scrot "$HOME/Pictures/animation.gif"
Scrot can select a format from the filename extension. The current Debian manual lists JPG, PNG, GIF, and other formats; the Ubuntu Jammy manual describes explicit format selection and fallback behavior. If neither an explicit format nor a recognized extension determines the format, the manuals document PNG as the fallback.
Specify a format explicitly
scrot --format png "$HOME/Pictures/shot.bin"
Use the explicit format option only when your installed version documents it. An extension that matches the intended format is usually clearer for humans and downstream tools.
Recommended Free Tools
Quote every path
scrot "$HOME/Pictures/Release notes 2026.png"
Double quotes protect spaces, wildcard characters, and shell expansion. In scripts, build the path in a variable and quote the variable at the point of use:
out="$HOME/Pictures/shot $(date +%Y-%m-%d).png"
scrot "$out"
The date expression above is handled by Bash; scrot receives the resulting filename as one argument.
Rank #3
- 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*
Run a command after the image is saved
The execution option runs a command after capture. The manual documents special strings for referring to the saved image, but those strings can differ between versions, so inspect man scrot before copying an example into production. A documented pattern is:
scrot --exec 'mv "$f" "$HOME/Pictures/"'
Verify the special variable supported by your package and test with a harmless destination first. If the post-save command fails, the screenshot may still have been written; check the expected directory before retrying.
Use scrot in reliable Bash scripts
Create the destination and stop on basic errors
#!/usr/bin/env bash
set -euo pipefail
out="$HOME/Pictures/scrot-captures/$(date +%Y-%m-%d_%H-%M-%S).png"
mkdir -p "$(dirname -- "$out")"
scrot "$out"
printf 'Saved %sn' "$out"
mkdir -p makes the destination if needed. set -euo pipefail causes common shell failures to surface instead of silently continuing. The timestamp reduces accidental overwrites, although two captures in the same second can still collide; add a higher-resolution timestamp or another unique suffix if that matters to your workflow.
Capture a known rectangle after a delay
#!/usr/bin/env bash
set -euo pipefail
out="$HOME/Pictures/dashboard.png"
scrot --delay 3 --autoselect 100,100,640,480 "$out"
printf 'Saved %sn' "$out"
Keep the coordinate system documented alongside the script. Window movement, monitor order, desktop scaling, and display changes can invalidate hard-coded coordinates.
Check the result in a script
if scrot "$HOME/Pictures/check.png"; then
echo "Screenshot captured"
else
echo "Screenshot failed" >&2
exit 1
fi
A successful command means scrot completed its operation; it does not prove that the image shows the content you expected. For unattended jobs, also test that the output file exists and is non-empty, then retain useful stderr in your job log.
Rank #4
- 【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
Performance, reliability, and compatibility
- Timing: Full-screen and region captures are normally one-shot operations. Delays add predictable waiting time but do not wait for a web page or application to finish rendering.
- Storage: PNG is lossless and can be larger; JPG is often smaller but introduces compression. Choose based on the consumer of the file, not only the extension.
- Overwrites: Reusing a fixed filename can replace an earlier capture. Timestamped or otherwise unique names avoid that failure mode.
- Display sessions: The cited manuals establish command-line capture behavior, not universal support across desktop environments or display servers. If capture fails, verify that scrot is installed, that the process is running inside the intended graphical session, and that the session permits screen capture.
- Wayland: The available manuals do not establish general Wayland compatibility. Do not assume an X11-oriented command will work unchanged; check your distribution’s documentation and test the actual session.
- Permissions: A writable destination is required. In a service, cron job, or remote shell, environment variables and access to the graphical display may differ from your interactive terminal.
Troubleshooting common failures
scrot: command not found
Scrot is not installed or is not on the script’s PATH. Install the package supplied by your distribution, then run scrot --help and man scrot to confirm the available options.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The command runs but no file appears
Check the exact expanded path, parent-directory permissions, and whether the command returned a nonzero status. A quoted absolute path makes this easier to diagnose:
out="$HOME/Pictures/test.png"
printf 'Writing to %qn' "$out"
scrot "$out"
ls -l -- "$out"
The capture is blank or fails in a script
Compare the script’s environment with your interactive desktop session. A scheduled job may lack the display connection or authorization that your terminal has. Also check whether the active display server is supported by your package; the manuals cited for this procedure do not promise compatibility with every environment.
The wrong area is captured
Recheck the coordinate order as x, y, width, height, then inspect monitor arrangement and scaling. For a one-off capture, use --select instead of guessing coordinates.
An option is rejected
Option sets vary between releases. Run scrot --help, read the local manual, and adapt the command to that installed version. Do not copy a flag documented for Debian testing into an older package without checking.
Free tools Windows power users keep installed
One-click scans. No signup required.
Best Value
- 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
The post-save command cannot find the image
Confirm the special-string syntax documented by your version of scrot. Test the capture without --exec first, then add a simple command that prints its arguments before performing a move or upload.
Or skip the browser setup
If what you really need is a screenshot of a website rather than your desktop, ScreenshotNeo provides a single HTTP request and an MCP server for AI agents. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers.
Use the API documentation at https://screenshotneo.com/docs/ for all options. A direct cURL request is:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
The same request in Python:
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
And in Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
ScreenshotNeo also supports full-page captures with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets plus custom viewports, retina scale, PDF output with paper size, margins, landscape, and page ranges, HTML/CSS-to-image, custom CSS and JavaScript, pre-capture clicks, hidden selectors, waits for selectors, delays or network idle, blocking ads, trackers, requests or resource types, custom headers, cookies, user agents and Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed links, asynchronous jobs with signed webhooks, bulk capture of 100 URLs per call, a usage API, and an OpenAPI specification. Parameters used by other screenshot APIs also work to ease migration.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallAn MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Every feature is available on every plan. Sign up free for 1,000 screenshots a month—no card required.
Frequently Asked Questions
What does the name scrot mean?
The scrot manual expands it as “SCReenshOT,” the name of the command-line capture utility.
Which scrot version is documented for Ubuntu Jammy?
The Ubuntu Jammy manual identifies package version 1.7-1. That label applies to that Ubuntu release documentation, not necessarily to the version installed on another distribution.
Quick Recap
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.




