PricingFAQ
Log inSign Up

Linux Essentials: Step-by-Step Guides

Tutorials

28 Aug 2025

Linux Essentials: Step-by-Step Guides

Introduction

This guide is the first part of a series on Linux basics. It focuses on getting started with the terminal, using the Linux command line, and running commands. If you are new to Linux, learning how to use the terminal is essential, since it’s the main way to control a Linux server.

Let’s begin by looking at what a terminal emulator is.

Terminal Emulator

A terminal emulator is a program that lets you use the terminal inside a graphical environment. Since most people use operating systems with a GUI for everyday work, a terminal emulator is the usual way to access the Linux command line.

Here are some free and common terminal emulators by platform:

  • macOS: Terminal (default), iTerm2
  • Windows: ConEmu, Windows Terminal, PuTTY
  • Linux: GNOME Terminal, Konsole, XTerm

Different emulators have different features, but modern ones typically include tabs, text highlighting, and customizable settings.

The Shell

The shell is the program that interprets commands you type in and passes them to the Linux operating system. It also runs scripts.

Some popular shells include:

  • bash (Bourne Again Shell)
  • zsh (Z Shell)

Each shell has unique features, but all support redirection, variables, condition checks, and more.

This tutorial uses bash, which is the default shell on most Linux distributions (Ubuntu, Fedora, RHEL, etc.).

The Command Prompt

When you log into a server, you usually first see the Message of the Day (MOTD) — a short message with information like the Linux version. After that, you are placed at the command prompt, where you can type commands.

Example of a default Ubuntu prompt:

sammy@webapp:~$


Breakdown:

  • sammy → the current username
  • webapp → the server’s hostname
  • ~ → the current directory (here, the user’s home directory /home/sammy)
  • $ → the prompt symbol for a normal user


If logged in as root in /var/log, it may look like this:

root@webapp:/var/log#

Notice the # symbol. This indicates the root user, which has full administrative control over the system.

Running Commands

Commands are run by typing the name of a program (binary or script). Linux provides many built-in commands for tasks like file navigation, installing software, or configuring the system.

When you run a command, it becomes a process. By default, commands run in the foreground, meaning you must wait until they finish before typing more commands.

⚠️ Remember: Linux is case-sensitive. Filenames, directories, commands, and options must be typed exactly.

Without Arguments or Options

If you run a command with no arguments or options, it behaves in its default way. For example:

  • cd → returns you to your home directory
  • ls → lists the contents of the current directory
  • ip → shows usage information
ls
Image

With Arguments

Arguments modify how commands behave. For example:

cd /usr/bin

This changes the directory to /usr/bin. You’ll notice your command prompt updates to show the new path.

Check the contents with:

ls
Image

With Options

Options (flags or switches) further control commands. They start with a - (single letter) or -- (long name).

For example, with ls:

  • -l → detailed list with permissions, sizes, and timestamps
  • -a → show hidden files (those starting with .)
ls -l

ls -la

The second command shows hidden files like . and ...

Image

With Options and Arguments

Options and arguments can be combined. For example:

ls -la /home

Here:

  • ls → command
  • -la → options
  • /home → argument (directory to list)

Environment Variables

Environment variables are key-value pairs that influence how commands and processes behave. They are set automatically when you log in.

View All Environment Variables

env
Image

Look for the PATH variable:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

The PATH tells the shell where to look for executables when you run commands.

View a Variable’s Value

To show the value of a variable:

echo $PATH

echo $HOME

$HOME expands to your home directory. If a variable is not set, it expands to an empty string.

Image

Setting Environment Variables

Set a variable like this:

VAR=value

If it already exists, its value is replaced. If not, it’s created.

Image

To make a variable available to child processes, use export:

export PATH=$PATH:/opt/app/bin

Verify:

echo $PATH

⚠️ Changes made this way only apply to your current session. To make them permanent, you must edit configuration files, which will be covered later in this series.

linuxhow-tobasicsubuntututorials

Read also

Linux Essentials: Step-by-Step Guides

Linux Essentials: Step-by-Step Guides

Tutorials

Learn the basics of the Linux terminal — what it is, how the shell and command prompt work, and how to run your first commands.

Linux Reboot Command Detailed Tutorial

Linux Reboot Command Detailed Tutorial

Tutorials

Learn how to reboot a Linux system the right way. This guide explains safe reboot methods, common issues, and practical tips for servers, desktops, and automated scripts.

Mastering SSH Port Forwarding: Local, Remote, and Dynamic Modes

Mastering SSH Port Forwarding: Local, Remote, and Dynamic Modes

Tutorials

SSH port forwarding is a secure method for accessing remote services, bypassing firewalls, and protecting sensitive data over untrusted networks. This guide covers the three main types—local, remote, and dynamic—with setup steps, real-world use cases, troubleshooting tips, and examples to help you apply them effectively.

Products

Server in the United StatesServer in the United KingdomServer in NetherlandsServer in SingaporeServer in Poland

NOVPS CLOUD LTD ©2025