Skip to content
BENIBIX Learn

Terminal and Shell Basics

Level 1 · Typing commands

What the command line is, and how the terminal and the shell split the work. Why most servers run Linux and are used by typing, not clicking.

Course contentsLesson 1 of 10

After this lesson you can

  • Tell the terminal from the shell
  • Run a command and read its reply
  • Say why servers are run by typing

10 mincovers 5 glossary entries

What happens when you type a command

The command line is a way to use a computer by typing instead of clicking. You type one line, press Enter, and the computer runs it and prints a reply. Two programs share the work. The terminal is the window you type into. The shell reads your line and runs it. On Linux, the usual shell is bash.

Linux is the system that runs most of the world's servers. It is free, and many groups ship their own version of it. Ubuntu is the one most guides assume, so the examples in this course use it. The commands work the same way on nearly every version.

When the shell is ready, it shows a short line ending in a $ sign. You type after it. The first word is the command, such as ls. The words after it change what it does. A word that starts with a dash, such as -l, is an option.

The shell finds the program with that name, starts it and waits. Whatever the program prints comes back to the terminal window. Then the $ sign returns, and you can type the next line. If the program finds nothing to say, it often prints nothing at all.

The terminal and the shell are easy to mix up, because they always appear together. A terminal is like a phone, and the shell is the person on the line. You can change the phone and keep the same person, or the other way round. That is why the same commands work in any terminal app.

Servers are run this way for good reasons. A server usually has no screen, and typing works fine over a slow link. Commands can be saved in a file and run again, exactly the same, next week or on a hundred servers.

The command line does exactly what you say, at once, with no undo. There is no bin to restore from. A common mistake is to paste a command from a web page without reading it. Read every word first, and if one is new, look it up before you press Enter.

console
$ echo Hello
Hello
$ whoami
emma
Two commands and their replies. The $ sign means the shell is ready for the next one.
The terminal shows the words. The shell reads them and starts the command.

Worked example

Jack finds a big folder

Jack's laptop is almost full. In the file manager he clicks through 40 folders and still cannot find what is taking the space.

In the terminal he types one line, du -sh * in his home folder. In two seconds it lists every folder with its size. The biggest is 38 gigabytes of old videos.

The words for this lesson5

Check yourself

What sets the terminal apart from the shell?

Finished this lesson?

Marking it complete also marks its 5 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.