Nanohost logo
PricingFAQ
Log inSign Up

Linux Essentials: Step-by-Step Guides

Tutorials

28 Aug 2025

Linux Essentials: Step-by-Step Guides full

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

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

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 ...

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

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.

Setting Environment Variables

Set a variable like this:

VAR=value

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

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.

Conclusion

Now that you’ve taken your first steps with the Linux terminal and learned a few basic commands, you have a solid foundation to build on. In the next tutorial of this series, you’ll explore how to navigate files, view their contents, and edit permissions to manage your system more effectively.

linuxhow-tobasicsubuntututorials

Read also

How to Reboot Linux Now (Safely): systemctl reboot, shutdown -r now, and Force-Reboot Options

How to Reboot Linux Now (Safely): systemctl reboot, shutdown -r now, and Force-Reboot Options

Tutorials

Whether you’re applying kernel updates, clearing a stuck device, or finishing a configuration change, a reboot is sometimes the cleanest fix. This guide shows beginner-friendly and safe ways to restart Linux immediately (“reboot now Linux”), plus how to force reboot if the system is unresponsive. We’ll cover desktops, servers, and remote machines over SSH.

Linux Navigation and File Management

Linux Navigation and File Management

Tutorials

Learning how to move around and manage files and folders in the Linux filesystem is one of the most important skills for working with any computer. On cloud servers, these tasks are usually done through the terminal using well-known Linux shells and standard commands. This guide will walk you through some of the essential skills needed to work with files and directories from the terminal.

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.

Products

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

NOVPS CLOUD LTD ©2025