← 返回命令列表

Linux command

gpm 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo gpm -m /dev/input/mice -t ps2

Example

sudo gpm -m /dev/ttyS0 -t ms

Example

sudo gpm -m [path/to/mouse_device] -t [mouse_type] -D

Kill

sudo gpm -k

Example

sudo gpm -m [path/to/mouse_device] -t [mouse_type] -R

Example

gpm -t help

说明

gpm (General Purpose Mouse) provides mouse support for the Linux virtual console (text mode). It enables copy/paste functionality, mouse cursor movement, and mouse button events in console applications. Text selection is done by holding the left button and dragging. Middle button pastes selected text. Right button extends selection. This provides clipboard functionality similar to X11 in pure text mode. In repeater mode (-R), gpm can pass mouse events to X server, allowing both console and X applications to share the mouse device.

参数

-m _DEVICE_
Mouse device (e.g., /dev/input/mice, /dev/ttyS0)
-t _TYPE_
Mouse type (ps2, ms, imps2, etc.)
-R _TYPE_
Repeater mode for X server; optionally specify output type
-D
Debug mode; run in foreground
-k
Kill running gpm daemon
-B _SEQUENCE_
Button sequence (1, 2, 3 or permutation)
-2
Force two-button mouse emulation
-3
Force three-button mouse emulation

FAQ

What is the gpm command used for?

gpm (General Purpose Mouse) provides mouse support for the Linux virtual console (text mode). It enables copy/paste functionality, mouse cursor movement, and mouse button events in console applications. Text selection is done by holding the left button and dragging. Middle button pastes selected text. Right button extends selection. This provides clipboard functionality similar to X11 in pure text mode. In repeater mode (-R), gpm can pass mouse events to X server, allowing both console and X applications to share the mouse device.

How do I run a basic gpm example?

Run `sudo gpm -m /dev/input/mice -t ps2` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -m _DEVICE_ do in gpm?

Mouse device (e.g., /dev/input/mice, /dev/ttyS0)