Submitted by drupalmaster on

The terminal that you normally access in a Linux distro is called the Pseudo-Terminal. If you run the command:

$ tty

at the system prompt, it should report something like the following in stdout:

/dev/pts/0

indicating that you are in a pseudo-terminal (pts). See man pts and man tty for more information. If, on the other hand, you run the command:

$ who

the stdout will look something like the following:

<your user> tty7         2023-05-28 22:30 (:0)

Indicating that your actual real terminal is a tty7 terminal. The pts is actually a slave for the master tty7 in this case.

If the system freezes and you're unable to further troubleshoot the problem and potentially kill the process that has locked up your Linux system (assuming the lock up isn't related to memory), then you can execute the keystroke combination of:

Ctrl + Alt + F1 (thru F6)

and this will drop you out to a tty. Typically, if you use F1, you'll be dropped into a tty1. If, on the other hand, you use F2 instead, then you'll wind up in a tty2, and so forth through tty6 for F6. This will prompt you to log in, so using your usual user credentials will get you to a system prompt where you can then execute top or htop by simply typing in those commands. Running the keystroke combination of:

Ctrl + Alt + F7

will send you back to the pseudo-terminal.

While in a tty, you should be able to kill an errant process and restore. If not, then you can at least run the command:

$ sudo shutdown -r now

then, enter your credentials to restart your system.

Category