← 返回命令列表

Linux command

fbgrab 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Take a screenshot

fbgrab [screenshot.png]

Take a screenshot

fbgrab -d [/dev/fb1] [screenshot.png]

Take a screenshot

fbgrab -c [1] [screenshot.png]

Wait 5 seconds

fbgrab -s [5] [screenshot.png]

Convert a raw framebuffer dump

fbgrab -w [1920] -h [1080] -b [32] -f [framebuffer.dump] [screenshot.png]

Set PNG compression

fbgrab -z [9] [screenshot.png]

说明

fbgrab reads the Linux framebuffer device (/dev/fb*) or a dump thereof and saves a PNG image file. It can capture screenshots of virtually any application, from traditional text applications to X-windows desktops and framebuffer applications. The tool is particularly useful for capturing screenshots on systems without a running X server, embedded systems, or when working directly with the Linux console.

参数

-?
Display usage information.
-a
Ignore the alpha channel. Useful for pixel formats like BGR32 where drivers incorrectly report alpha.
-b _bitdepth_
The number of bits per pixel. Optional when reading from device.
-c _console_
Specifies which console (virtual terminal) to grab.
-C _console_
Switch console with a delay before capturing.
-d _device_
Framebuffer device to use. Defaults to FRAMEBUFFER environment variable or /dev/fb0.
-f _filename_
Read from file instead of device. Requires -w, -h, and -b options.
-h _height_
The height of the framebuffer in pixels. Optional when reading from device.
-i
Turns off ADAM7 interlacing in the output PNG.
-l _line_length_
Line length (stride) in pixels between the start of each row. Optional when reading from device.
-s _seconds_
Seconds to wait before grabbing the screenshot.
-v
Enable verbose output.
-w _width_
The width of the framebuffer in pixels. Optional when reading from device.
-z _compression_
Set PNG compression level (0=fast, 9=best).

FAQ

What is the fbgrab command used for?

fbgrab reads the Linux framebuffer device (/dev/fb*) or a dump thereof and saves a PNG image file. It can capture screenshots of virtually any application, from traditional text applications to X-windows desktops and framebuffer applications. The tool is particularly useful for capturing screenshots on systems without a running X server, embedded systems, or when working directly with the Linux console.

How do I run a basic fbgrab example?

Run `fbgrab [screenshot.png]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -? do in fbgrab?

Display usage information.