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

There isn’t one screenshot command that works across every operating system. On Linux, first check whether your session uses X11 or Wayland: ImageMagick’s import captures X server screens, while GNOME provides a separate screenshot utility. On Windows, the Snipping Tool command opens an interactive capture interface; Microsoft also documents a GDK command-line utility for game-development environments. For macOS, verify the syntax in the local screencapture manual rather than relying on a command that may not match your version.

Choose a command for your system and capture type

Before running a command, decide whether you need an unattended file saved automatically or an interactive selection overlay. Also check whether you want the full screen, a window, or a region. These distinctions matter: a command that opens a selection interface is not the same as a scriptable capture that writes a file without user input.

Environment Method What it does Important qualification
Linux with X server access ImageMagick import Captures the screen, a window, or a selected area Documented for X server screens; do not assume it works in every Wayland session. ImageMagick documentation
Linux with GNOME gnome-screenshot Captures the screen, active window, or selected area Options shown here come from the Debian unstable manual; check your installed version. Debian manual
Windows desktop Snipping Tool protocol Opens an interactive capture mode It launches a UI; the documentation does not establish a silent command-line save. Microsoft documentation
Windows application code Graphics.CopyFromScreen Copies screen pixels to a drawing surface in .NET code An API, not a built-in shell command. Microsoft API reference
Windows with Microsoft GDK wdcapture.exe Command-line capture using Windows Graphics Capture APIs GDK context; confirm the tool is available. Documented formats are PNG for SDR and JXR for HDR. Microsoft GDK documentation

Linux: capture with ImageMagick on X11

If ImageMagick is installed and the process can access an X server, capture the root window (the overall X screen) with:

magick import -window root screen.png

The ImageMagick manual’s full-screen example uses PostScript as the output filename; changing the extension to .png requests a PNG output. The command may capture what is visible across the root window rather than a clean, unobstructed view of one application. ImageMagick notes that root-window capture can include portions of other windows covering the selected window and can capture independent menus or popups. See its command-line options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Select a region or window

For an interactive selection, run:

magick import selection.png

ImageMagick’s example prompts you to click or drag to choose what to capture. The utility can also capture a selected window by clicking it or by passing a target argument; check the import manual for the syntax supported by your installed version. ImageMagick Import documentation

Check the display session

These commands are specifically grounded in X server capture. If your desktop session is Wayland, do not infer compatibility from a successful installation of ImageMagick. Use a capture tool supported by your desktop/session, and consult that tool’s documentation; the available documentation here does not establish a universal Wayland command or compatibility matrix.

Linux: use GNOME Screenshot

The Debian unstable gnome-screenshot(1) manual describes whole-screen capture by default and these options:

  • gnome-screenshot captures the whole screen.
  • gnome-screenshot -w or --window captures the active window.
  • gnome-screenshot -a or --area lets you select an area.
  • gnome-screenshot -d 5 or --delay=5 waits five seconds before capture.

Because those option details are from a Debian unstable manual, check the help on your own installation before building a script around them:

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.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
gnome-screenshot --help

For a delayed capture, for example, confirm that your installed version accepts the delay option and then use the value you need. Do not assume identical flags across distributions or releases. Debian unstable gnome-screenshot manual

Windows: launch an interactive Snipping Tool capture

Microsoft documents launching Snipping Tool with the ms-screenclip: protocol. The capture interface supports rectangle, freeform, or window mode, with exactly one mode parameter. This is useful when a person can complete the selection, but it is not evidence of an unattended command that saves a named image file.

start ms-screenclip:

Use Microsoft’s Launch Snipping Tool documentation for the supported protocol URI and mode parameters. Since the protocol opens a capture UI, automation that requires a file written without interaction needs a different method.

Windows: capture from application code or Microsoft GDK

.NET screen-copy API

System.Drawing.Graphics.CopyFromScreen copies pixels from a specified screen rectangle to a drawing surface. Microsoft’s example is in a Windows Forms context, so treat it as an application-programming technique, not a PowerShell or Command Prompt command. The API reference includes the method signature and example: Graphics.CopyFromScreen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

GDK command-line capture

Microsoft documents wdcapture.exe as a PC command-line tool using Windows Graphics Capture APIs in the Microsoft Game Development Kit. Its documented output is PNG for SDR and JXR for HDR. This is a GDK-context option, not a general Windows utility guaranteed to be installed on every PC; check that the relevant GDK tools are available before relying on it. See Microsoft’s Screen Capture (wdcapture.exe) documentation for invocation details.

macOS: verify the local screencapture manual

macOS has a command-line screenshot utility, but exact current flags are not established by the technical references available for this article. Avoid copying an unverified command into a production script. On the Mac you will use, open Terminal and inspect the local manual:

man screencapture

Use the syntax and options documented for that installed macOS version. This is especially important when a script depends on unattended saving, a particular output path, or a specific capture mode.

Make command-line captures more dependable

  • Confirm the session and permissions. On Linux, establish whether the process has access to the relevant display server before choosing an X server capture command.
  • Choose the capture scope deliberately. A root-window screenshot can include overlapping windows, menus, or popups; use a window or region method if that is not what you want.
  • Separate interactive from unattended work. A command that opens a selection UI still needs a person to finish the capture. For scheduled or headless workflows, use a method documented for that environment.
  • Check output format and dynamic content. Confirm the file type and whether the capture method suits SDR or HDR needs. If the page or screen is still changing, a capture may occur before the content is ready.
  • Test before automating. Run once in the same account, session, and environment that will run the script; a desktop command may depend on an active graphical session.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

ImageMagick reports it cannot connect to a display

The capture process may not have access to an X server, or the current session may not be an X server session. Confirm the session type and that the command runs with the appropriate display access. The documented import method is for X server screens, not a universal Wayland solution.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

The capture includes another window or a popup

This can be expected with root-window capture: overlapping window portions and independent menus or popups may be captured. Choose a narrower window or region capture when you need a different scope.

gnome-screenshot rejects an option

The option may not be present in your distribution’s installed version. Compare the installed command’s --help output with the Debian unstable manual before changing the script.

Snipping Tool opens, but no file appears

The documented protocol starts an interactive capture mode. It does not establish that the command silently writes a screenshot to a specified path. Complete the UI interaction or use an appropriate application API or available capture utility.

wdcapture.exe is not found

The documented utility is part of the Microsoft GDK context, not a standard command on all Windows installations. Verify availability in the development environment you are using before depending on it.

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.
Best Value
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.

Or skip the browser setup

If what you need is a screenshot of a website rather than your local desktop, ScreenshotNeo is a website screenshot API and MCP server. A single GET request can return a PNG, JPEG, WebP, or PDF; see the API documentation for parameters and options.

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

ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up free for 1,000 screenshots a month, with no card required.

Frequently Asked Questions

Can a command-line screenshot tool capture a website page?

Yes. A local desktop capture records what is visible on the screen; a website screenshot API captures a URL directly. ScreenshotNeo provides a URL-based API and an MCP server for that web-page workflow.

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

Does the Snipping Tool protocol save a screenshot automatically?

The documented Snipping Tool protocol launches an interactive capture mode; it does not establish unattended saving to a file path.

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.