screendump
Capture an image of the computer screen
SYNOPSIS
screendump [options] [<console_number>]
Example: screendump 1 > tty1_output.txt
Example: screendump -n > current_scrollback.txt
PARAMETERS
-n
Dumps only the scrollback buffer, excluding the current screen content.
Requires kernel 2.6.9 or newer.
-d
Dumps the current screen content. This is the default behavior when -n is not specified.
-f
Forces a dump even if the console is in graphics mode.
Output may be unreadable garbage.
-h
Displays a brief help message and exits.
-V
Displays version information and exits.
-w <cols>
Specifies the width of the dumped screen in columns. Default is 80.
-L
Dumps the contents of the current active virtual console. Often used implicitly or with '0'.
<console_number>
The numerical identifier of the virtual console (e.g., 1 for /dev/tty1) to dump.
If omitted, the current console is often assumed.
DESCRIPTION
screendump is a utility from the kbd package that allows users to dump the textual content of a Linux virtual console (VC) to standard output. Unlike graphical screenshot tools, screendump captures the characters and attributes (like colors) from the console's text buffer, including its scrollback history if available. This command is particularly useful for debugging console applications, capturing error messages from non-graphical environments, or preserving text-mode output that scrolls off the screen. It operates at a low level, interacting directly with the kernel's console driver to retrieve the raw screen data. The output is typically raw character data, which can then be redirected to a file for later review or processing. It's an essential tool for system administrators and developers working in a command-line-only environment.
CAVEATS
screendump works exclusively with Linux text virtual consoles. It cannot be used to capture graphical desktop environments (like GNOME, KDE, XFCE) or applications running within them. For graphical screenshots, different tools like scrot, gnome-screenshot, or import (ImageMagick) are required. Dumping a console in graphics mode with -f can result in unreadable output. The -n (scrollback) option requires a relatively modern kernel (2.6.9+).
OUTPUT FORMAT
The output of screendump is raw character data from the console buffer. It does not produce image files like PNG or JPEG. To save the output, it should typically be redirected to a file, e.g., `screendump 1 > /tmp/tty1_dump.txt`. The output includes character attributes, but these are generally not directly visible unless parsed by a tool that understands console codes.
VIRTUAL CONSOLES
Linux typically provides several virtual consoles (VTs), accessible via Ctrl+Alt+F1 through Ctrl+Alt+F6 (or higher). screendump targets a specific VT by its number, allowing administrators to capture output from background processes or other logged-in users on different consoles.
HISTORY
screendump is part of the kbd package, which provides a set of utilities for controlling the Linux console and keyboard. These tools have been fundamental to the Linux command-line environment since its early days, predating widespread graphical desktop usage. screendump specifically addresses the need to capture ephemeral text output from the console, a common requirement for debugging and system management in a text-only setup. Its functionality has remained largely consistent, with minor enhancements like the scrollback buffer option (-n) being added as kernel capabilities evolved. It remains a niche but vital tool for interacting directly with the Linux console.