Skip to content

Terminal, console, shell, and TTY

Module
Your First Linux Session
Difficulty
Easy
Updated
Tested on
Ubuntu 24.04.4 LTS, GNOME 46
On this page

Suppose a guide for a desktop that stopped responding tells you: “Switch to a TTY, log in on the console, and type the command in the shell.” You have seen one place to type commands: the window that opened in lesson B02.3 when you pressed Ctrl+Alt+T. Was that window a TTY, a console, or a shell? And where do you type when the desktop is gone?

By the end of this lesson, you can say what each of the four words in the title names, read the prompt part by part, and follow that guide in your VM: switch to a console, log in, and come back to the desktop.

  • Desktop and session basics (B03.1). Start rootvolt-lab and log in as learner.
  • This lesson runs two commands, tty and ps. Type each one exactly as shown and press Enter. Module B04 explains how commands are built.

The screens were captured in Ubuntu 24.04.4 LTS in VirtualBox 7.2.18 on a Windows host, with the VM’s screen at 1440 × 900.

Press Ctrl+Alt+T. On a Windows or Linux host, use the left Ctrl key: the right one is VirtualBox’s Host key. A window titled learner@rootvolt: ~ opens. In the tested VM, it held one line, with a cursor after it:

Screen
learner@rootvolt:~$

If your VM shows a few lines of text above it, lesson B03.3 explains them.

This window is GNOME Terminal, Ubuntu’s default terminal. Its help calls it “a terminal emulator application for accessing a UNIX shell environment”. A terminal emulator is a program that draws a window that works like a text screen with a keyboard: it passes your keys to another program and shows the text that program sends back. GNOME Terminal itself does not understand commands.

The program that does is the shell: lesson B01.3 defined it as a program that reads the commands you type and starts the programs they name. The shell in this course is Bash. GNOME Terminal starts Bash when the window opens, and Bash prints the line above.

That line is the prompt. The Bash manual says Bash shows it “when it is ready to read a command”. It has four parts:

Part Means
learner The user you are logged in as
rootvolt The computer’s name, which you chose in lesson B02.3
~ The directory you are in. ~ stands for your home directory, the folder that Files showed as Home in lesson B03.1
$ Bash is waiting for a command

The @ and the : only separate the parts. A directory is what Files calls a folder; module B05 explains directories. The window’s title repeats the user, computer, and directory.

Type this and press Enter:

Terminal window
tty

In the tested VM, it printed:

Screen
learner@rootvolt:~$ tty
/dev/pts/0

tty prints the name of the terminal it is connected to. The answer is a file name, because the kernel gives every terminal a terminal device: a file in the directory /dev. GNOME Terminal and Bash talk through it. Your keys go into the device, and Bash reads them there; what Bash and its programs write to it appears in the window.

pts stands for pseudoterminal: a terminal device that the kernel creates for a program, not for a real screen and keyboard. Its manual page says pseudoterminals are used “for implementing terminal emulators”. The 0 is its number: /dev/pts/0 is the first one.

Now type this and press Enter:

Terminal window
ps

In the tested VM, it printed:

Screen
learner@rootvolt:~$ ps
PID TTY TIME CMD
3034 pts/0 00:00:00 bash
3097 pts/0 00:00:00 ps

ps lists your programs that are running on this terminal. A running program is called a process, and PID is the number the kernel gives it; your numbers will differ. Module B13 explains processes. The TTY column names the terminal device without /dev/.

Look at the list again. bash is the shell behind your prompt, and ps was running while it made the list. GNOME Terminal is missing: it does not run on the terminal device, it holds the other end and draws the window.

Leave the first window open and press Ctrl+Alt+T again. Guess first: what will tty print in the second window?

Run it, then compare with your guess

In the tested VM, the second window showed:

Screen
learner@rootvolt:~$ tty
/dev/pts/1
learner@rootvolt:~$

Each terminal window gets its own pseudoterminal and its own Bash. That is also why, in lesson B04.2, each open terminal keeps its own history.

From the keyboard to Bash, in a terminal window and on the console In a terminal window, what you type goes from the keyboard to GNOME Terminal, the terminal emulator, and on to Bash, the shell, which starts the program named by the command. The output of Bash and of the program goes back to GNOME Terminal, which shows it in the window. On the text console, what you type goes from the keyboard to the console, tty3, which the kernel provides, and on to Bash; the output goes back to the console. In a terminal window Keyboard GNOME Terminal terminal emulator input input starts output The program named by the command On the text console Keyboard Console (tty3) from the kernel input input output Bash shell Bash shell
From the keyboard to Bash, in a terminal window and on the console In a terminal window, what you type goes from the keyboard to GNOME Terminal, the terminal emulator, and on to Bash, the shell, which starts the program named by the command. The output of Bash and of the program goes back to GNOME Terminal, which shows it in the window. On the text console, what you type goes from the keyboard to the console, tty3, which the kernel provides, and on to Bash; the output goes back to the console. In a terminal window Keyboard GNOME Terminal terminal emulator input input starts output The program named by the command On the text console Keyboard Console (tty3) from the kernel input input output Bash shell Bash shell
Simplified model. In a terminal window, keys go through GNOME Terminal to Bash, which starts the program the command names; output comes back to the window. On the text console, keys go through the console, tty3, to Bash.

In a terminal window, what you type goes from the keyboard to GNOME Terminal, the terminal emulator, and on to Bash, the shell. Bash starts the program that the command names, such as tty. The output, and Bash’s next prompt, go back to GNOME Terminal, which shows them in the window. On the text console, the next topic, the console takes the place of GNOME Terminal.

This is a simplified model. Most importantly, it leaves out the terminal device between the terminal and the shell, the name that tty prints: /dev/pts/0 for the first window, /dev/tty3 for the console.

A text console, or console, is a terminal that the kernel provides directly on the screen and keyboard, with no desktop and no window. Linux has several, with the devices /dev/tty1, /dev/tty2, and so on.

Ctrl+Alt and a function key switch consoles, but on a Linux host, the VirtualBox manual warns, the host catches those keys. In a VM, use the Host key and the function key instead; the manual says this simulates “Ctrl+Alt+Fx to switch between virtual terminals in a Linux guest”. Virtual terminal is another name for a text console.

Press Host+F3: the right Ctrl key and F3, on a Windows or Linux host. VirtualBox sends Ctrl+Alt+F3 to the VM. On a Mac host, the Host key is the left Command key; this course was not tested on a Mac host.

The desktop disappears. In the tested VM, the screen turned black, with two lines at the top:

White text on black: the line Ubuntu 24.04.4 LTS rootvolt tty3, a blank line, and the line rootvolt login:.
The text console after Host+F3, cropped to the top left corner; the rest of the screen is black. Ubuntu 24.04.4 LTS in VirtualBox 7.2.18 on Windows.
  1. tty3: the console you are on, the device /dev/tty3.
  2. rootvolt login:: the console asks for your user name.

The first line names the release, the computer, and the console. There is no mouse pointer and no list of accounts: you type everything.

Type learner and press Enter. The console shows Password:. Type your password and press Enter.

In the tested VM, nothing appeared while the password was typed, not even dots, and the login worked. That is normal on the console. The login looked like this:

Screen
Ubuntu 24.04.4 LTS rootvolt tty3
rootvolt login: learner
Password:
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 7.0.0-42-generic x86_64)
…
learner@rootvolt:~$

The … stands for more welcome text: links to Ubuntu’s documentation, a count of updates, and a license notice. The kernel version, 7.0.0-42-generic, and the number of updates vary between VMs.

Look at the last line: the same prompt as in the window. Bash is waiting again, this time on the console. Guess first: what will tty print here?

Run it, then compare with your guess

Run tty, then ps. In the tested VM, the console showed:

Screen
learner@rootvolt:~$ tty
/dev/tty3
learner@rootvolt:~$ ps
PID TTY TIME CMD
3259 tty3 00:00:00 bash
3362 tty3 00:00:00 ps

/dev/tty3, not a pts name: the console is not a pseudoterminal but a terminal device of the kernel’s own, the tty3 from the first line.

ps shows a bash with a different PID: a third Bash, started for this login. The shells in the windows are not listed, because ps lists only the processes on the terminal where you run it.

The console after these steps:

White text on black. Below the line Ubuntu 24.04.4 LTS rootvolt tty3: rootvolt login: learner, Password:, and the line Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 7.0.0-42-generic x86_64), followed by links to Ubuntu documentation, a note that 113 updates can be applied, and the license notice. At the bottom: tty printed /dev/tty3, and ps listed bash and ps, both on tty3.
The text console after logging in and running tty and ps; the right part of the screen is cropped. Ubuntu 24.04.4 LTS in VirtualBox 7.2.18 on Windows.
  1. The user name you typed, and Password:, after which nothing appeared.
  2. The kernel version. Yours may differ.
  3. tty prints /dev/tty3.
  4. ps lists bash and ps, both on tty3.

First, log out of the console. Type this and press Enter:

Terminal window
exit

In the tested VM, rootvolt login: appeared again: the console’s Bash ended.

Then press Host+F2: the right Ctrl key and F2. VirtualBox sends Ctrl+Alt+F2 to the VM, and in the tested VM the desktop came back.

Now read the guide’s sentence again, word by word:

Word What it names In your VM
Terminal A place to type text and read text, on a screen or in a window. A terminal emulator, such as GNOME Terminal, provides one in a window The windows from Ctrl+Alt+T
Console A terminal that the kernel provides directly, without a desktop The screen after Host+F3
TTY A terminal device, the file that tty prints /dev/pts/0, /dev/pts/1, /dev/tty3
Shell The program that reads your commands and starts the programs they name Bash, in every one of them

The kernel’s documentation spells TTY out as teletypewriter, and uses it for all terminal devices, pseudoterminals included. So “switch to a TTY, log in on the console” means one thing twice: switch to a text console, such as tty3, and log in there. “The shell” is Bash, behind the prompt in every terminal.

The console seems frozen at Password:. You type, and nothing changes on the screen. The console does not show a password while you type it. Type the whole password and press Enter.

Stuck on the console. You want the desktop back, and the console shows a prompt or rootvolt login:. Typing exit does not help: it ends your login on the console, and rootvolt login: appears again. Press Host+F2, the right Ctrl key and F2, as in the tested VM.

Taking GNOME Shell for the shell. A guide says “type this in the shell”, and you type the command into the overview’s search box. That box belongs to GNOME Shell, the program that draws the desktop, which is not a shell despite its name. As in lesson B03.1, it searches for apps and settings; it does not run the command. Type the command at the Bash prompt in a terminal.

Goal: Show that every terminal has its own Bash: two windows and one console.

  1. Open two terminal windows, if they are not still open, and run ps in each.
  2. Write down the PID of bash and the TTY in each window.
  3. Switch to the console, log in, run ps, and write down the same two values.
  4. Log out of the console and return to the desktop.

Expected: Three different PIDs for bash, and three different TTY values: two pts names and tty3.

Hint

ps lists only the processes on the terminal where you run it. The console key is the Host key with F3; the way back is the Host key with F2.

Solution
  1. Press Ctrl+Alt+T twice, with the left Ctrl key, and run ps in each window.
  2. Each list has one bash line, with a pts name such as pts/0 or pts/1; the numbers depend on how many windows are open. The PIDs differ.
  3. Press Host+F3, log in as learner, and run ps. The bash line shows tty3 and a third PID.
  4. Type exit, then press Host+F2.

Three terminals, three shells, each reading from its own terminal device.

  • A terminal emulator such as GNOME Terminal draws a window, passes your keys to the shell, Bash, and shows what comes back. GNOME Shell draws the desktop; it is not a shell.
  • The prompt learner@rootvolt:~$ shows the user, the computer, and the directory, ~ for your home directory; $ means Bash is waiting for a command.
  • Every terminal has a terminal device, the name tty prints: /dev/pts/N for a terminal window, /dev/ttyN for a console. TTY is the general word for them.
  • The text console is a terminal that the kernel provides without a desktop. In the VM, Host+F3 switches to tty3, exit logs out there, and Host+F2 brings the desktop back.

Next, in Regular users, root, and privileged actions (B03.3), you find out what the user learner may do, and which actions need more.

All sources were checked on 3 November 2026, except the GNU Bash Reference Manual, which could not be reached that day.

  • GNOME Terminal Help: Introduction, which describes Terminal as a terminal emulator.
  • Ubuntu 24.04 manual pages: tty(1); ps(1), with the processes it lists by default and its columns; and bash(1), section PROMPTING, with the user, computer, and directory in the prompt.
  • Linux manual pages: pts(4), on pseudoterminals and terminal emulators.
  • GNU Bash Reference Manual: What is a shell? and Controlling the Prompt.
  • Linux kernel documentation: Linux allocated devices, which lists /dev/tty1 as the “First virtual console” and /dev/pts/0 as the first pseudo-TTY; and TTY, which spells out TTY as teletypewriter.
  • Oracle VirtualBox User Guide, release 7.2: Working with Virtual Machines, on the Host key and on Host key + function key for virtual terminals in a Linux guest.