Display Htop on TTY8

From WikiMLT

Here is shown how to dis­play the out­put of any com­mand like as our­nalctl, dmesg, sar, a di­rec­to­ry watch­er, tail ‑f, or htop (which is the cur­rent ex­am­ple) to tty8, that can be ac­ti­vat­ed by Crtl+Alt+F8 – us­ing Sys­temd ser­vice.

To do that we need to cre­ate a ser­vice file – this is htop-tty8.service in the fol­low­ing ex­am­ple. Then start the ser­vice and en­able it to be au­to start­ed at the boot time.

sudo nano /etc/systemd/system/htop-tty8.service
[Unit]
Description=htop on tty8

[Service]
Type=simple
ExecStart=/usr/bin/htop
StandardInput=tty
StandardOutput=tty
TTYPath=/dev/tty8

[Install]
WantedBy=multi-user.target
sudo systemctl start htop-tty8.service
sudo systemctl enable htop-tty8.service

The source of this post is an an­swer pro­vid­ed by Rinzwind at Ask Ubun­tu: What is the pur­pose of ctrl+alt+f8?