28 Aug 2025
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.
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:
Different emulators have different features, but modern ones typically include tabs, text highlighting, and customizable settings.
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:
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.).
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 usernamewebapp
→ 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.
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.
If you run a command with no arguments or options, it behaves in its default way. For example:
cd
→ returns you to your home directoryls
→ lists the contents of the current directoryip
→ shows usage informationls
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
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 ..
.
Options and arguments can be combined. For example:
ls -la /home
Here:
ls
→ command-la
→ options/home
→ argument (directory to list)Environment variables are key-value pairs that influence how commands and processes behave. They are set automatically when you log in.
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.
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.
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.
Learn the basics of the Linux terminal — what it is, how the shell and command prompt work, and how to run your first commands.
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.
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.