← 返回命令列表

Linux command

getty 命令

文本

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

常用示例

Start getty on

getty [tty1] [38400]

Auto-login user

getty -a [username] [tty1]

With specific term

getty -T [linux] [tty1] [38400]

Wait for carrier

getty -w [ttyS0] [9600]

说明

getty (get teletype) opens terminal ports, sets modes, and invokes login. It manages the login prompt on system consoles and serial ports. The program is started by init/systemd for each terminal requiring login access. It handles baud rate detection for serial terminals and terminal type configuration. getty provides the foundational login interface for Unix systems.

参数

-a _USER_, --autologin _USER_
Auto-login specified user.
-n, --skip-login
Don't prompt for login.
-T _TERM_, --term _TERM_
Terminal type.
-w, --wait-cr
Wait for carrier/carriage return.
--help
Display help information.

FAQ

What is the getty command used for?

getty (get teletype) opens terminal ports, sets modes, and invokes login. It manages the login prompt on system consoles and serial ports. The program is started by init/systemd for each terminal requiring login access. It handles baud rate detection for serial terminals and terminal type configuration. getty provides the foundational login interface for Unix systems.

How do I run a basic getty example?

Run `getty [tty1] [38400]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a _USER_, --autologin _USER_ do in getty?

Auto-login specified user.