Take Screenshots from the Terminal (scrot / gnome-screenshot)
Capture the full screen, a window or a selected area to a timestamped PNG using scrot or gnome-screenshot.
Run `scrot '%Y-%m-%d-%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/'` to save a timestamped screenshot of the whole screen.
01Command
Command
$ scrot '%Y-%m-%d-%H%M%S_$wx$h.png' -e 'mv $f ~/Pictures/'02What it does
The format string names the file with date, time and resolution; `-s` lets you click a window, `-d 5` delays five seconds (useful for menus), and `-u` captures only the active window. On GNOME, `gnome-screenshot -f file.png` and `gnome-screenshot -a` (area) do the same without installing scrot. Under Wayland on GNOME, scrot may not see other windows — use GNOME's Print Screen UI or grim on wlroots-based desktops.
03Risk
!Warning: scrot is an X11 tool; on GNOME Wayland sessions it can only capture it as an XWayland client sees the screen, so prefer the desktop's own tool there.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- gnome-screenshot(1) - Linux manual pageEvidence: gnome-screenshot captures the screen, a window or an area on GNOME desktops and saves it to a file or the clipboard.
- scrot(1) - Linux manual pageEvidence: scrot captures the screen using imlib2, supports filename format specifiers like date, size and window ID, selection with -s, delay with -d, and -e to run a command on the result.
Last verified: 2026-09-18 · Category: System & Settings