The Shell
100%

Command Line · Lesson 1

The Shell

Learn what the Linux shell is and how commands are executed.

What is the Linux Shell

Welcome to your Linux journey! The first step is understanding the Linux shell. A shell is a program that accepts commands you type, asks the operating system to run them, and then prints the result back to your terminal.

If you have used a graphical user interface, you are used to clicking windows, menus, and buttons. In the command line, you type precise instructions instead. Applications named "Terminal", "Console", or "Konsole" usually open a shell session for you.

The terminal is the window or app you type into, while the shell is the program running inside it.

The shell is useful because it is fast, scriptable, and available on almost every Linux system. As you learn more commands, you can combine them to inspect files, manage directories, search text, install software, and automate repeated work.

Which statement correctly describes the relationship between a terminal and a shell?

Interacting with the Bash Shell

For this course, we will focus on Bash, short for Bourne Again Shell. Bash is one of the most common Linux shells and is a good foundation even if you later use zsh, fish, or another shell.

When you open a terminal, you will be greeted by the shell prompt. Its appearance can vary, but it often shows your username, host name, and current directory.

pete@icebox:/home/pete $

The $ symbol indicates that the shell is ready to accept your input as a normal user. You do not type this symbol when entering commands; it is shown by the shell. If you see # instead, you are usually working as the root user, which has more power and more risk.

What does the $ at the end of the example prompt indicate?

Commands often follow this pattern:

command options arguments

For example, in echo Hello World, echo is the command and Hello World is the text passed to it.

In echo Hello World, which part is the command name?

Your First Linux Command

Let's start with one of the most basic Linux commands for beginners: echo. This command displays the text you provide back to the terminal.

$ echo Hello World
Hello World

Try a few more examples:

$ echo Linux is fun
Linux is fun
$ echo "Hello from Bash"
Hello from Bash

Quotes are useful when you want the shell to treat several words as one piece of text.

Which command makes the shell treat Hello from Bash as one quoted piece of text?

Common Beginner Tips

  • Press Enter to run a command.
  • Use the Up Arrow key to recall a previous command.
  • Commands and filenames are case-sensitive in Linux.
  • Spaces matter. echo hello and echohello are different.
  • If a command seems stuck, Ctrl-C often cancels it.

Lesson complete

You finished The Shell

You can now explain the role of a shell and interact with a basic shell prompt.

  • Distinguish between a terminal and a shell.

  • Identify a command prompt.

  • Run a simple command with echo.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Command Line