The Shell - Your Command Center

The shell is a program that reads the commands you type and asks the kernel to run them. The most common shell is bash (Bourne Again SHell).

Analogy: The shell is a conversation. You type a request, press Enter, the system does it and replies. That little bit of text waiting for you is the prompt.

Read a typical prompt left to right:

labuser@shellgenius:~$
  │         │        │ └ $ = normal user  (# would mean root/admin)
  │         │        └ ~ = current directory (~ means your home)
  │         └ hostname (which machine)
  └ username (who you are)

Every command follows the same grammar:

command  -options  arguments
  ls       -l -a     /etc
$ whoami
labuser
$ ls -la /etc | head -3
total 1240
drwxr-xr-x 1 root root  4096 Jan  1 10:00 .
drwxr-xr-x 1 root root  4096 Jan  1 10:00 ..
Tip: Press Tab to auto-complete commands and paths - it saves typing and prevents typos. Press the Up arrow to recall your last command.

Try whoami, hostname, and ls -la in the terminal below.