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

There is no single screenshot command that works on every computer. Use screencapture on macOS, choose a capture tool that matches your Linux display environment, and treat Microsoft’s wdcapture as a Windows Game Development Kit (GDK) tool—not a command guaranteed to exist on every Windows PC. The commands below save image files; check the output path and test in the desktop session you actually need to capture.

Choose a command for your operating system

System or environment Starting point Availability and important qualification
macOS screencapture -h or man screencapture macOS includes the native screenshot utility. Confirm the installed version’s flags in its local help or manual; Apple’s support guide describes the Screenshot app and screenshot experience, not a command-line flag reference.
Linux using X11 scrot output.png Install scrot if it is not already present. Its display option references X; do not assume it is a general Wayland solution.
KDE desktop spectacle --help Spectacle can be launched from the command line and offers a background mode. Use the installed help for the exact arguments supported on your system.
Windows with GDK wdcapture screenshot --filepath <filepath> Microsoft documents this in its Windows Game Development Kit documentation. Verify that GDK is installed and that this developer tool suits your system; it is not established as a universal Windows command.

First decide whether you need the whole screen, a region, or a window, and whether a person can make a selection or the capture must run unattended. Also identify the logged-in desktop session and display system: a command that works locally may not behave the same in a remote shell, an automated job, or a different display environment.

Take a screenshot from the macOS command line

macOS provides the native screencapture command. Since the Apple support material describes the Screenshot app rather than documenting CLI flags, do not copy options from another macOS version or assume that a shortcut behaves exactly like a command-line invocation. Ask the installed system for its own usage information:

screencapture -h
man screencapture

Read the output before building a script: it is the appropriate place to confirm the flags your installed macOS accepts and how that version expects an output location. Then run a small test and check that the file was written where you intended. If you need a visual, interactive capture instead, Apple’s Screenshot app supports full-screen, selected-area, and window/menu captures. Apple says its UI workflow saves to the desktop by default unless the save location is changed; the app also provides a timer and save-location controls. These are UI details, not confirmation of particular CLI flags.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
LAPGEAR Home Office Pro Lap Desk - Black Carbon, Fits 15.6” Laptops
  • Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

Apple notes that some apps may not allow screenshots of their windows, including Apple TV. A missing or protected window capture may therefore be a restriction of the app or content, not a malformed output filename.

Take a screenshot on Linux

X11: use scrot for a direct file capture

On an X11 session with scrot installed, the simple documented example is:

scrot output.png

This writes a screenshot to the file named output.png in the command’s current working directory. The filename extension selects the image format; PNG is the fallback if the name has no extension. To change where the file goes, provide a path in the filename, such as ~/Pictures/desktop.png.

Rank #2
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Useful documented options include the following. Check scrot --help or the installed manual first, because options can differ between releases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Need Option Example
Choose a fixed rectangle -a X,Y,W,H scrot -a 100,80,800,600 region.png
Let a person select an area -s scrot -s selection.png
Wait before capture -d SEC scrot -d 5 delayed.png
Use a particular display -D DISPLAY Consult the installed help for the display value your X session uses.
Capture a monitor or multiple displays -M NUM or -m Confirm monitor numbering and option behavior in the installed manual.
Capture the focused window or a window ID -u or -w NUM Use -w with the relevant window ID.
Set output name or write to standard output -F FILE Use -F - for standard output where supported by the installed version.

For example, to pause five seconds and save a full capture under a chosen name, run scrot -d 5 ~/Pictures/desktop.png. A delay is useful when a menu or tooltip must appear, but it does not make the capture unattended-safe by itself: the desktop session still needs to be available and in the expected state.

Wayland or KDE: use the desktop’s supported tool

Do not treat scrot as a universal Linux screenshot command. Its documented display handling refers to X, and the available documentation does not establish it as a Wayland solution. On Wayland, select a capture utility supported by the desktop environment and consult its local help. KDE’s Spectacle can be started from a terminal and has a background mode intended for scripting without opening its GUI or requiring user interaction. Start with:

Rank #3
Sale
Yilador Webcam Cover 3 Pack, 0.03 inch Ultra Thin Laptop Camera Cover Slide
  • Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
  • 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
  • ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
  • ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
  • ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
spectacle --help

Use the options printed by your installed version rather than inferring command-line arguments from Spectacle’s keyboard shortcuts or GUI modes. KDE documents shortcuts for all monitors, the active window, and a rectangular region; those shortcut descriptions should not be substituted for the exact CLI syntax of your installed release.

Take a screenshot from a Windows command line

Microsoft documents wdcapture.exe as a PC command-line tool in the Windows Game Development Kit. Its documented form includes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wdcapture screenshot --filepath C:UsersPublicPicturesscreen.png

The tool’s documented options include --filepath <filepath>, --hdr, and --display <display-id>; Microsoft describes it as capturing through Windows Graphics Capture APIs. This is a GDK developer-kit route. Check that GDK is installed and consult its installed tool help or the relevant GDK documentation for the accepted display identifier and other syntax before scripting it.

Rank #4
AboveTEK Portable Laptop Lap Desk w/Retractable Left/Right Mouse Pad Tray, Non-Slip Heat Shield Tablet Notebook Computer Stand Table w/Sturdy Stable Work Surface for Bed Sofa Couch or Travel
  • Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
  • Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
  • Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
  • EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
  • Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.

Do not assume that PowerShell includes a universal built-in screenshot command, or that wdcapture is available on a standard Windows installation. If the executable is not found, the likely issue is availability or path—not a missing PowerShell verb. Use a supported tool for the Windows environment you have rather than pasting Linux or macOS commands into PowerShell.

Make command-line captures reliable

  • Check the destination. Relative filenames go to the command’s current working directory; use an explicit path when a script or scheduled task may start elsewhere. Confirm the directory exists and that the running account can write to it.
  • Run in the intended desktop session. Test while signed into the same session and display environment as the real job. A remote login, background process, locked desktop, or different account can change what is capturable.
  • Confirm target and display selection. For multiple monitors, window IDs, or a fixed rectangle, verify the actual numbering, coordinates, and behavior on the target machine. Do not assume another release or desktop uses identical conventions.
  • Separate image capture from clipboard capture. A file-producing command and a UI shortcut that copies an image to the clipboard are different workflows. Do not infer a CLI clipboard option from a platform’s screenshot UI.
  • Check for protected content and overlays. Some apps may restrict capture. A consent dialog, popup, or chat widget can also be part of the visible page; native desktop screenshot commands do not imply that page content will be cleaned first.
  • Validate the result. After a scripted capture, check that the file exists, has a plausible size, opens in an image viewer, and shows the intended display. A command returning without an obvious error does not prove the image is the one you meant to capture.

Troubleshoot common command-line screenshot failures

Symptom Likely cause What to do
command not found or executable not found The utility is not installed or is not on the command’s search path. On Linux, check whether scrot or Spectacle is installed. On Windows, verify GDK availability before relying on wdcapture. On macOS, confirm the native utility and its local help.
The capture is blank or shows the wrong display The command ran in a different or unavailable graphical session, or selected a different display than intended. Run a manual test in the target logged-in desktop session; check the display selection and monitor details in that utility’s local help.
Region or window selection behaves differently than expected Coordinates, window IDs, monitor numbering, or flags vary by utility and release. Verify syntax in the installed manual, then test with a small capture before automating.
The output file is missing The script used an unexpected current directory, invalid path, or unwritable destination. Use an explicit destination path, confirm its parent directory exists, and verify write access for the account running the command.
Only a blank or protected app area appears The application or protected content may prevent window capture. Try a permitted capture target if appropriate; do not treat a content restriction as a file-format problem.
Works interactively but fails unattended The automated process is not running in the same active desktop session or cannot make an interactive selection. Use a documented noninteractive mode such as Spectacle’s background capability where appropriate, inspect local flags, and test under the actual automation account and session.
Option rejected after an update The installed utility’s command-line options differ from the example or prior version. Run its current --help or manual and adapt the script to that installed release.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If what you need is a screenshot of a web page rather than your computer’s desktop, a website screenshot API avoids setting up a browser and display session. ScreenshotNeo takes a URL in one GET request and returns an image or PDF. Before capture it accepts cookie or consent banners like a visitor and removes supported consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response includes page-verdict and billing headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients.

Example using cURL (replace the URL with the page you want to capture):

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for the API details. If you prefer Python:

Best Value
Sale
LAPGEAR Home Office Lap Desk – Pink, Fits 15.6” Laptops
  • Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
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)

Or, with 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}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await require('node:fs/promises').writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));

ScreenshotNeo includes 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. A browser-based desktop screenshot and a URL-based web-page capture solve different problems, so use the API when the target is a page you can identify by URL—not when you need an image of another application on your local screen. Start with ScreenshotNeo’s free plan: sign up for 1,000 screenshots a month with no card.

Which method should you use?

For an interactive capture, the operating system’s screenshot controls may be simpler than a terminal. For a repeatable file capture, use the native or desktop utility documented for your OS and display environment, and verify its local options before putting them into automation. On X11, scrot output.png is a straightforward starting point; on KDE, consult Spectacle’s help for its background options; on macOS, check the installed screencapture manual; and on Windows, use wdcapture only when the GDK context applies.

Frequently Asked Questions

Does a command-line screenshot capture go to the clipboard?

Not necessarily. The commands described here are oriented toward saving an image file. Clipboard behavior is a separate workflow, so verify it in the specific utility’s local documentation.

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

Can I use one screenshot command in a cross-platform script?

Not reliably as written: the commands and their availability depend on operating system, installed utility, and Linux display environment. A script needs platform-specific selection or a web-page capture API when the target is a URL.

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.