Linux Terminal, Shell and Prompt Explained
A terminal is an interface for sending text input and displaying text output. A shell is the program that interprets your commands. Bash is one common shell on Linux. A prompt is the shell’s signal that it is ready for input; it is not part of the command you type.
Print your first message
Open the Terminal application in your lab desktop. At the prompt, type only the line below, then press Enter. printf prints formatted text. Here %s means text and \n (one backslash followed by n) adds a new line; the quoted message is the value to print. The quotes keep the words together.
Expected output: Hello, Linux! followed by a newline. The prompt returns after the command completes. The command does not create or change a file.
Read the result in three parts: your typed command, the printed message, and the next prompt. Only the message is the output requested by the command. A returning prompt means the shell is ready for more input; it does not by itself prove the preceding command succeeded.
Read a sample terminal session
In this illustrative transcript, learner@lab:~$ is a customized prompt: learner is a user label, lab is a machine label, and ~ commonly represents the home directory. The next line is output. Do not type the prompt prefix.
Illustrative transcript — do not copy
learner@lab:~$ printf '%s\n' 'Ready'Readylearner@lab:~$A $ prompt commonly suggests a normal user; # often suggests root (the privileged administrator account). Prompt text is configurable, so neither symbol proves privilege. In this course, use a normal user and verify your effective identity with whoami in the next lesson.
Shell versus terminal
The terminal displays text and relays keyboard input. The shell interprets the entered text. Some commands such as Bash’s printf are built into the shell; other commands launch separate programs. A terminal can host another shell, and Bash can also run without a graphical terminal.
Mistakes and practice
If you copy a prompt, the shell may try to execute its text as a command. Copy only the command line. If a quote is left open, Bash can display a continuation prompt instead of running the command; press Ctrl+C to abandon the unfinished input in this interactive lab and try again. Now print My first terminal command by changing only the quoted message.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Terminal, shell and prompt — Knowledge Check
Apply the core ideas and safe practices from this lesson.
What interprets commands you type?
In learner@lab:~$ printf ... which part should be omitted when copying a command?
What is printed by the code below?
printf '%s\n' 'Ready'A prompt ends with $. What can you conclude?