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 userIf 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.
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.
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.
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.
Learn the basics of the Linux terminal — what it is, how the shell and command prompt work, and how to run your first commands.