---
id: 2025-05-13-lpic-1-understanding-the-linux-command-line-shell-terminal-and-first-commands
slug: lpic-1-understanding-the-linux-command-line-shell-terminal-and-first-commands
title: "LPIC-1: Understanding the Linux Command Line: Shell, Terminal, and First Commands"
excerpt: "From the shell to the first login: the Linux command line as the foundation for LPIC-1 and day-to-day administration."
date: "2025-05-13T11:40:50+02:00"
updated: "2025-05-13T11:41:02+02:00"
author:
  name: "Sebastian Palencsar"
  handle: "spalencsar"
category: "lpic-1-serie"
tags: ["lpic-1", "lpic-1-serie", "bashshell", "linuxadmin", "linuxcertification", "linuxcommand", "terminalbasics"]
reading_time: 25
toc: true
---

LPIC-1 exam 101 starts with GNU and Unix commands. If you are working toward Linux administrator certification or you want a firmer command-line foundation, this is the first module of the series.

## About LPIC-1

The [LPIC-1 certification (Linux Professional Institute Certification Level 1)](https://www.lpi.org/our-certifications/lpic-1-overview/){.badge-link-text} is the entry point into professional Linux administration. It splits into exam modules 101 and 102. The series covers the topics you need for both modules, step by step, with a focus on practical use and clear explanations.

<blockquote class="infobox infobox--practice">
❗ **Important note:** This series does not replace an official exam-prep course for the [LPIC-1 certification](https://www.lpi.org/our-certifications/lpic-1-overview/){.badge-link-text}. It is a practice-oriented, structured companion for self-study, so you can understand and apply the denser topics more reliably.
</blockquote>

### Target audience of the series

**Who this module is for:**

* Linux beginners with technical curiosity who want to build command-line skills systematically
* Aspiring IT professionals who are working toward LPIC-1
* Switchers from other IT fields who want a solid Linux foundation
* Practitioners who want followable examples and explanations instead of theory alone

### Teaching structure and practice focus

The module walks you through Linux commands step by step — from simple filesystem navigation through to process and permission work.

**The teaching pattern:**

* Every command is explained and shown with practical examples
* You see **why** a command matters and **where** you will use it in operations
* Dedicated notes flag what LPIC-1 pays attention to

<blockquote class="infobox infobox--info">
💡 **Note on the visual cues:** Colour-coded infoboxes mark practice tips, pitfalls and exercises so you can prepare for LPIC-1 without guessing which remarks are exam-critical.
</blockquote>

## How to work through this module

For the best result, use a Linux environment while you read — a virtual machine, a Docker container or a native install. Linux sticks when you type it. Run the commands, change parameters and watch what happens.

The Linux command line is the core of every LPIC-1 exam and the daily tool of an administrator in training. The rest of the module stays on that tool.

## Understanding the Linux command line

### What is the shell?

The shell is the main way you talk to a Linux system — a text interface between you and the kernel. Instead of clicking a GUI, you type commands that the system then runs.

🔧 **Practical example:**

When you type `ls` and press Enter, this happens:

1. You type: `ls`
2. The shell interprets: “the user wants to see the contents of the current directory”
3. The shell looks up the `ls` program
4. The program runs
5. The result is printed on the screen.

The name “shell” is not accidental. It wraps the kernel — the actual core of the operating system — and keeps you from talking to it raw.

### The shell as translator and broker

The shell does several jobs:

* **Command interpretation**: it reads and interprets the commands you type
* **Program execution**: it starts programs and manages their run
* **Input and output control**: it moves data between programs and standard devices
* **Script execution**: it can run sequences of commands (scripts) automatically
* **Error handling**: it reports success or failure back to you

<blockquote class="infobox infobox--info">
💡 **Tip:** The shell has a memory — the up arrow walks through recent commands. That saves a lot of typing, especially on long or complex lines.
</blockquote>

### Why the shell matters so much on Linux

On Windows the command line is often a last resort when the GUI fails. On Linux it is the other way around:

* The shell is often the **fastest and most efficient** way to get work done
* Many **admin tasks** are only partly available in graphical tools
* **Automation** of complex work is straightforward with shell scripts
* The shell gives **consistent behaviour** across Linux distributions
* **Server installs** often have no graphical session at all

<blockquote class="infobox infobox--warn">
⚠️ **Watch out:** As a Linux administrator you will spend a large part of the working day in the shell. Confident use of it is a hard requirement for LPIC-1.
</blockquote>

### The shell in action

Most beginners are surprised how powerful and efficient the shell can be.

**Practice scenario: filtering and batch copy**

You want to find every text file that contains the word "`important`" and copy those files into a new directory. With graphical tools that is a long click path.

**In the shell:**

```bash
mkdir important_files
find . -type f -name "*.txt" -exec grep -l "important" {} \; -exec cp {} important_files/ \;
```

Those two lines do the whole job — from creating the target directory through finding and copying every matching file.

<span class="nb-accent">Talking to the shell</span>

<span class="nb-accent">The basic interaction with the shell follows a simple pattern:</span>

The shell shows a **prompt** that typically looks like this:

```bash
username@hostname:~/directory$
```

You type a `command` (optionally with options and arguments):

```bash
ls -la /home
```

You press `Enter` to run it. The shell prints the `result` and then shows the prompt again for the next command.

<blockquote class="infobox infobox--practice">
❗ **Typical beginner mistake:** Linux commands are case-sensitive. `LS` is not the same as `ls` and will produce an error.
</blockquote>

### The shell’s place in operations

Shell fluency is required for any kind of Linux administration. For LPIC-1 you need a solid grasp of the basics, because they underpin almost every later topic — filesystem, user management, networking.

<blockquote class="infobox infobox--info">
💡 **Exam-prep tip:** LPIC-1 contains many questions that tie directly or indirectly to the shell. Pay attention to command syntax, how parameters are passed, and what the various shell features actually do.
</blockquote>

Treating the shell as the central interface between user and system is the key to getting work done on Linux. The next sections cover the different shells and your first practical steps on the command line.

### Bash vs. other shells

Bash (Bourne Again Shell) is the default shell on most Linux distributions — but it is far from the only one. Different shells have different strengths, and you should know them for LPIC-1.

<span class="nb-accent">Bash — the Linux default</span>

**Bash** (Bourne Again SHell) was developed in 1989 by Brian Fox as a free extension of the original Bourne shell (`sh`). It became the default on most Linux distributions for good reasons:

* Extensive **command-line editing** (arrow keys, history)
* Strong **Tab completion** for commands and filenames
* Flexible **aliases** and **functions** to speed up work
* **Scripting** with variables, loops, conditionals and more
* A customisable **prompt**

🔧 **Practical example Bash features:**

```bash
# Tab completion
cd /ho[TAB]  # completes to "/home/"

# Command history
history      # shows recent commands
!42          # runs history entry 42

# Alias for a frequent command
alias ll='ls -la'
ll           # runs 'ls -la'
```

### Important alternative shells

**1. The Bourne shell (sh)**

Stephen Bourne’s original Unix shell is the parent of modern shells and is usually a symbolic link to another shell today:

* Maximum **script compatibility**
* **Minimal** feature set
* Almost no interactive extras

<blockquote class="infobox infobox--info">
💡 **Tip:** When you write shell scripts that must run on many systems, use `/bin/sh` syntax for maximum portability.
</blockquote>

**2. The Z shell (zsh)**

Zsh has gained a lot of ground and is now the default shell on macOS:

* Richer **Tab completion** and spelling correction
* **Theme** frameworks such as Oh-My-Zsh
* Stronger **globbing** (filename patterns)
* **Bash compatibility** plus extra features

**3. The Korn shell (ksh)**

Developed by David Korn at AT&T, it combines POSIX conformance with extra features:

* Strong focus on **scripting**
* Good **performance** even on complex scripts
* Common in **enterprise** environments

**4. The C shell (csh) and TENEX C shell (tcsh)**

These shells use C-like syntax and add specific features:

* **Syntax** modelled on the C language
* Extended **aliasing**
* Useful **job-control** features

<blockquote class="infobox infobox--warn">
⚠️ **Watch out:** C shell script syntax differs sharply from the others. Scripts do not port without work.
</blockquote>

**5. The Friendly Interactive Shell (fish)**

A modern shell built for ease of use:

* Automatic **syntax highlighting**
* Smart **suggestions** from history
* An intuitive **web UI** for configuration
* Weaker **compatibility** with traditional shells

### Finding and changing the current shell

Several ways show which shell you are using:

```bash
# Current login shell
echo $SHELL
/bin/bash

# Alternative
ps -p $$
PID  TTY          TIME CMD
1234 pts/0        00:00:00 bash
```

<span class="nb-accent">Switching shells</span>

Switching is simple — type the name of the shell you want:

```bash
bash    # Switch to Bash
zsh     # Switch to Zsh
sh      # Switch to the Bourne shell
```

**To change your default shell permanently, use `chsh`:**

```bash
chsh -s /bin/zsh
```

<blockquote class="infobox infobox--practice">
❗ **Typical mistake:** After you change the default shell you must log in again before the change takes effect.
</blockquote>

### Shell script compatibility and shebang

For administrators, the different script syntax of each shell matters:

```bash
# Bash/sh style (POSIX)
for i in 1 2 3; do
    echo $i
done

# C-shell style
foreach i (1 2 3)
    echo $i
end
```

<blockquote class="infobox infobox--info">
💡 **Exam tip:** For LPIC-1 concentrate on Bash and its features, but know the basic differences to other shells. The exam often asks you to distinguish POSIX shells (sh, bash, ksh) from C-like shells (csh, tcsh).
</blockquote>

<span class="nb-accent">The shebang line at the start of a script</span>

The shebang line at the top of a script selects the shell that runs it:

```bash
#!/bin/bash    # runs with Bash
#!/bin/sh      # runs with sh
#!/bin/zsh     # runs with Zsh
```

<blockquote class="infobox infobox--warn">
⚠️ **Operational note:** If a script must stay compatible with other shells, use `#!/bin/sh` and stick to POSIX constructs. For advanced features that exist only in one shell, pick that shell explicitly.
</blockquote>

This is not only theory. In Linux operations you will meet different shell environments depending on the shop. Bash is the most common, but established enterprise setups and specialised roles still run other shells.

### Terminal emulator vs. virtual console

You can use the Linux command line in two fundamentally different ways: a terminal emulator inside a graphical session, or a virtual console. Both give you a shell. The differences matter for every Linux administrator.

<span class="nb-accent">The virtual console (TTY) — the direct path</span>

Virtual consoles (also called TTYs) are direct shell entry points with no GUI in between. They matter for administration and recovery.

**Hardware → kernel → virtual console → shell**

How you reach virtual consoles:

🔧 **Practical example:**

Press `Ctrl+Alt+F1` through `Ctrl+Alt+F6` to switch between virtual consoles. `Ctrl+Alt+F7` (or on some distributions F1 or F2) returns you to the graphical session.

**Properties of the virtual console:**

* Works even when the GUI has crashed or is missing
* Needs almost no system resources
* Limited display (mostly text, limited colour)
* Six virtual consoles by default (tty1 to tty6)

<blockquote class="infobox infobox--warn">
⚠️ **Watch out:** As a Linux administrator you must know virtual consoles. They are often the last way in when the graphical session is dead.
</blockquote>

<span class="nb-accent">The terminal emulator — graphical and flexible</span>

Terminal emulators are programs that run inside a GUI and mimic (or “emulate”) a classic terminal.

**Hardware → kernel → graphical session → terminal emulator → shell**

**Common terminal emulators:**

* **GNOME Terminal** (default in GNOME)
* **Konsole** (KDE)
* **xterm** (classic X11 terminal)
* **rxvt** and **urxvt** (lightweight alternatives)
* **Terminator** (with splitting)
* **XFCE Terminal** (XFCE)
* **Alacritty** (GPU-accelerated)

**Properties of terminal emulators:**

* Modern extras such as tabs, splits, transparent backgrounds
* Rich colour schemes and customisation
* Mouse copy and paste
* Integration with the desktop (drag and drop)
* Need a running graphical session

<blockquote class="infobox infobox--info">
💡 **Tip:** Most terminal emulators open a new tab with `Ctrl+Shift+T` — more practical than a pile of windows.
</blockquote>

### Technical architecture compared

A look at the stack makes the difference concrete:

**Virtual console:**

```markdown
┌─ Architecture: virtual console (TTY) ───────────────────────┐
│ [ Keyboard / screen ]                                       │
│            │                                                │
│            ▼                                                │
│ [ Linux kernel (TTY driver /dev/tty1..6) ]                  │
│            │                                                │
│            ▼                                                │
│ [ Login prompt (getty/login) ]                              │
│            │                                                │
│            ▼                                                │
│ [ Shell (/bin/bash) ]                                       │
└─────────────────────────────────────────────────────────────┘
```

**Terminal emulator:**

```markdown
┌─ Architecture: terminal emulator (PTY) ─────────────────────┐
│ [ Keyboard / mouse / display ]                              │
│            │                                                │
│            ▼                                                │
│ [ Display server (Wayland / X11) ]                          │
│            │                                                │
│            ▼                                                │
│ [ Terminal emulator (GNOME Terminal, Alacritty) ]           │
│            │                                                │
│            ▼                                                │
│ [ Pseudo-terminal master/slave (/dev/pts/X) ]               │
│            │                                                │
│            ▼                                                │
│ [ Shell (/bin/bash) ]                                       │
└─────────────────────────────────────────────────────────────┘
```

The differences show up in daily work:

* **Mouse support:** limited or missing on virtual consoles
* **Graphics:** terminal emulators can show images, virtual consoles cannot
* **Keyboard maps:** can differ between the two
* **Permissions:** virtual consoles often have a more direct path to hardware

<blockquote class="infobox infobox--practice">
❗ **Typical beginner mistake:** Many Linux newcomers panic when they land on a virtual console by accident. Remember: `Ctrl+Alt+F7` (or F1/F2) takes you back to the graphical session.
</blockquote>

**When to use which?**

The choice depends on the job:

**Use a virtual console for:**

* Repair when the GUI will not start
* Low resource use on older systems
* Server admin without a graphical session
* More direct hardware access

**Use a terminal emulator for:**

* Day-to-day admin next to other graphical apps
* Several terminal sessions (tabs)
* Copy and paste between the terminal and other apps
* Custom themes and colour schemes

**Operational differences**

You use the same shell in both places, but behaviour is not identical:

* **Environment variables:** terminal emulators often set more of them
* **Colour:** terminal emulators usually support 256 colours or more; virtual consoles often only 8 or 16
* **Character sets:** terminal emulators handle Unicode and special characters better

🔧 **Practical example:**

To see which environment you are in:

```bash
tty
/dev/pts/0    # terminal emulator (pseudoterminal)
```

or

```bash
tty
/dev/tty1     # virtual console
```

## Relevance for the LPIC-1 exam

**For LPIC-1 you should:**

* Know the difference between the two access methods
* Know how to switch virtual consoles
* Know the main terminal emulators and their basic features
* Understand when each method is appropriate

<blockquote class="infobox infobox--info">
💡 **Exam tip:** The exam can ask how you reach the system when the graphical session is down. The answer is almost always: a virtual console.
</blockquote>

You need to work effectively in both environments. As a Linux administrator you will not always get a choice — you use the tool that is still there, graphical terminal or bare console.

### First steps: login and navigation

Every Linux session starts with login and the first moves around the system. This section covers those fundamentals — from signing in to exploring the system safely.

### The login process (TTY vs. display manager)

Depending on the system configuration, login looks different:

**Graphical login:**
Most desktop distributions show a graphical login screen that asks for username and password. After a successful login you open a terminal emulator to reach the command line.

**Console login:**
Server installs or minimal systems often show a text login prompt directly:

```bash
Ubuntu 24.04 LTS tty1
login: username
Password: **********
```

🔧 **Practical example:**

When you type the password, no characters or asterisks appear — that is normal and a security feature. The input is still recorded.

<blockquote class="infobox infobox--warn">
⚠️ **Watch out:** After several failed login attempts Linux temporarily locks the account to slow brute-force attacks. If that happens, wait a few minutes before you try again.
</blockquote>

### Anatomy of the shell prompt

After a successful login the shell prompt greets you, roughly like this:

```bash
username@hostname:~/directory$
```

**That prompt carries useful information:**

* `username`: your current user name
* `@hostname`: the name of the system
* `~/directory`: your current working directory (`~` is your home directory)
* `$`: you are logged in as a normal user (root shows `#`)

<blockquote class="infobox infobox--info">
💡 **Tip:** The prompt is customisable. Later in the LPIC series you will shape it to your taste.
</blockquote>

### First orientation on the system (whoami, pwd, ls)

After login, orient yourself. These are the essential first commands:

```bash
whoami
username
```

<blockquote class="infobox infobox--info">
💡 Shows which user you are logged in as — especially useful when you switch accounts.
</blockquote>

```bash
pwd
/home/username
```

<blockquote class="infobox infobox--info">
💡 **p**rint **w**orking **d**irectory — shows which directory you are in.
</blockquote>

```bash
ls
Documents  Downloads  Pictures  Videos
```

<blockquote class="infobox infobox--info">
💡 **l**i**s**t — lists files and directories in the current folder.
</blockquote>

```bash
ls -l

total 16
drwxr-xr-x 2 username users 4096 May 10 15:20 Documents
drwxr-xr-x 3 username users 4096 May 12 09:45 Downloads
drwxr-xr-x 2 username users 4096 Apr 30 18:10 Pictures
drwxr-xr-x 2 username users 4096 Apr 30 18:10 Videos
```

<blockquote class="infobox infobox--info">
💡 With `-l` you get detailed information for every file and directory.
</blockquote>

<blockquote class="infobox infobox--practice">
❗ **Typical mistake:** Beginners often forget that Linux distinguishes case. `LS` is not `ls`. If you get `command not found`, check the spelling.
</blockquote>

### Navigating the filesystem with cd

To move around the filesystem you use `cd` (**c**hange **d**irectory):

```bash
cd Documents
pwd
/home/username/Documents
```

`cd` with no arguments always returns you to your home directory:

```bash
cd
pwd
/home/username
```

**Moving in the directory tree:**

```bash
cd ..          # one level up
cd ../..       # two levels up
cd /           # to the root directory
cd ~           # to the home directory (same as bare "cd")
cd -           # back to the previous directory
```

🔧 **Practical example:**

```bash
pwd
/home/username
cd /etc
pwd
/etc
cd -
/home/username
```

### Finding help on the command line (man and --help)

One of the most important skills is knowing how to get help:

**The `man` command** (manual):

```bash
man ls
```

<blockquote class="infobox infobox--info">
💡 Opens the full manual page for `ls`.
</blockquote>

**The `--help` option:**

```bash
ls --help
```

<blockquote class="infobox infobox--info">
💡 Prints a short help text directly in the shell.
</blockquote>

**The `info` command** (more detailed than man):

```bash
info ls
```

<blockquote class="infobox infobox--info">
💡 Often more structured and broader documentation.
</blockquote>

**The `whatis` query** (one-line description):

```bash
whatis ls
ls (1)               - list directory contents
```

<blockquote class="infobox infobox--info">
💡 **Tip:** In man pages you move with the arrow keys. Press `q` to quit and `/` followed by a term to search.
</blockquote>

<blockquote class="infobox infobox--warn">
⚠️ **Important:** Learn to read man pages. They look dense at first, but they are the most reliable information on the system itself.
</blockquote>

### Typical error situations and how to fix them

**Beginners often hit this:**

```bash
cd Documents
bash: cd: Documents: No such file or directory
```

That message means the directory `Documents` does not exist in the current working directory.

**To fix it:**

* Check with `pwd` where you are
* List available directories with `ls`
* Match the exact spelling, including case
* Try again or use an absolute path: `cd ~/Documents`

### Useful starter commands

A few more basic commands for the first steps:

```bash
date          # current date and time
cal           # calendar for the current month
clear         # clear the screen (or Ctrl+L)
exit          # leave the shell and log out (or Ctrl+D)
history       # list of recent commands
```

🔧 **Practical example:**

```bash
history | grep cd
123  cd Documents
145  cd ..
156  cd /etc
```

<blockquote class="infobox infobox--info">
💡 Shows every `cd` from your history — a fast way back to directories you already visited.
</blockquote>

## Why this matters for LPIC-1

Navigation and basic orientation are fundamental for every Linux administrator. LPIC-1 will test:

* Commands to explore the filesystem (`pwd`, `ls`, `cd`)
* Ways to get help (`man`, `--help`, `info`)
* Relative vs. absolute paths
* Basic shell features and key combinations

<blockquote class="infobox infobox--info">
💡 **Exam tip:** LPIC-1 often uses practical scenarios where you must find files or move into specific directories. Drill these basics until they are automatic.
</blockquote>

You need this later for configuration, software installs and troubleshooting. Every harder Linux task sits on these navigation skills.

## LPIC-1 exam information and preparation

To close the first module, here are the key facts for taking and preparing the official LPIC-1 certification.

### Exam structure (Exam 101 and Exam 102)

LPIC-1 consists of two separate exams:

* **LPIC-1 Exam 101**: system architecture, Linux installation and package management, GNU and Unix commands, devices and filesystems
* **LPIC-1 Exam 102**: shells and shell scripts, user interfaces, administrative tasks, system services, networking fundamentals and security

Each exam has 60 questions (multiple choice and fill-in) and a 90-minute time limit. You need at least 500 of 800 points to pass.

## Exam delivery, cost and registration

You have two main options for sitting LPIC-1:

* **Online exam with remote proctoring (OnVUE):** taken through the Pearson VUE OnVUE system and watched via webcam.
* **Exam at an authorised test centre:** on site at Pearson VUE centres worldwide (many cities, including Berlin, Hamburg, Frankfurt, Munich, Cologne and others).

LPIC exams are also often offered at reduced community rates at open-source events (such as Chemnitzer Linux-Tage, FrOSCon or Tübix).

**To register you need:**

* An official **LPI-ID**, which you create free of charge in the LPI portal.
* A valid **photo ID** for identity checks on the exam day.

The fee for LPIC-1 Exam 101 is typically about 200 USD (or the regional euro equivalent). Exams are available in German and English and further languages.

<blockquote class="infobox infobox--info">
💡 **Tip:** Prepare against the current objectives for version 5.0 (exam codes 101-500 and 102-500). Those objectives are the binding source of the questions.
</blockquote>

## Command Reference (Cheatsheet)

| Command | Category | Description |
|---|---|---|
| `whoami` | Identity | Shows the user name of the active shell session |
| `pwd` | Navigation | Prints the current working directory (*print working directory*) |
| `ls -la` | Filesystem | Lists all files in detail, including hidden files |
| `cd /path` | Navigation | Changes to the given directory (bare `cd` jumps to home) |
| `echo $SHELL` | Shell info | Prints the path of the user’s default login shell |
| `chsh -s /bin/zsh` | Shell config | Permanently changes the current user’s default login shell |
| `tty` | Terminal info | Prints the filename of the connected terminal (`/dev/ttyX` vs. `/dev/pts/X`) |
| `man command` | Documentation | Opens the full manual for the given command |
| `which command` | Path lookup | Shows the full path of the executable |

## Further Resources

| Resource | Description |
|---|---|
| [LPI: LPIC-1 Exam 101 Objectives](https://www.lpi.org/our-certifications/exam-101-objectives/){.badge-link-text} | Official objectives for exam 101 (topic 103: GNU and Unix commands) |
| [LPI Learning Materials](https://learning.lpi.org/en/learning-materials/101-500/){.badge-link-text} | Official free learning materials from the Linux Professional Institute |
| [GNU Bash Reference Manual](https://www.gnu.org/software/bash/manual/){.badge-link-text} | Full reference from the Free Software Foundation for GNU Bash |
| [Rheinwerk: LPIC-1 handbook](https://www.rheinwerk-verlag.de/lpic-1-sicher-zur-erfolgreichen-linux-zertifizierung/){.badge-link-text} | Companion book for LPIC-1 exams 101-500 and 102-500 |

## Conclusion

Command-line fluency is not only the core of exam 101, it is the daily tool of every administrator. This first module covered how the shell sits between you and the kernel, how TTYs differ from graphical terminal emulators, and how you find your bearings on the command line.

The next LPIC-1 module covers practical file management: [LPIC-1: basic navigation and filesystem commands](/en/lpic-1-serie/lpic-1-basic-navigation-and-filesystem-commands){.badge-link-text} – creating, moving, finding and processing files to LPI exam standard.

**Course overview:** [All LPIC-1 articles and modules](/en/category/lpic-1-serie){.badge-link-text}
