console

最後更新: 2020-07-21

 


Device

  • /dev/tty        Current TTY device
  • /dev/console  System console (set as a parameter at boot time)
  • /dev/tty0       Current virtual console
  • /dev/tty1       Ctrl+Alt+F1

 * tty = controlling terminal for a session, like sending signals (Ctrl+C)

 


grub.conf

 

# Default points to /dev/tty0

console=ttyS0

After that your /dev/tty0 is a monitor and /dev/console is /dev/ttyS0.

 


Blank Screen

 

X

Disable the Blank Screen on Raspberry Pi

  • xset s off                    # disable the screen saver
  • xset -dpms                 # disables the DPMS (Display Power Management Signaling)
  • xset s noblank             # tells to X server to not blank the video device

/etc/lightdm/lightdm.conf

[SeatDefaults]
xserver-command=X -s 0 -dpms

console (no desktop GUI)

# kernel parameter (read-only)

cat /sys/module/kernel/parameters/consoleblank

600

# Raspberry Pi

/boot/cmdline.txt

consoleblank=0

setterm

--blank

# Unit: minutes

# Get

setterm --blank

# Set

setterm --blank 0

--powersave off              Turns off monitor VESA powersaving features.

# 0 to disable

effective when run on a real VT; affects all real TTYs; not effective when run in screen sessions on a VT.

 


Console Fonts

 

/usr/share/consolefonts

?.psf.gz

 


Output to another Console

 

i.e.

run a command on a TTY1 from a SSH session

echo msg1 > /dev/tty1

cmatrix > /dev/tty1 &

htop > /dev/tty1 &