Chapter #2: How to Manage Files and Directories in Linux
Learn the basics of the command line, filesystem structure, shell commands, and essential terminal skills in this beginner-friendly guide.

Welcome to your next step in the Linux journey! Now that you've got your virtual machine ready, it's time to start talking to Linux - and we do that through the command line.
This chapter will teach you:
- How Linux organizes files and folders
- What the shell is and how to use it
- Basic commands to move around and manage files
- Cool tricks like redirection, pipelines, history, and tab completion
Letβs get started...
The Filesystem Hierarchy Standard
A quick glance at distrowatch.com will give us but a glimpse of the vast number of Linux distributions available today. Some of them are maintained by well-known companies or free software initiatives, whereas others represent the contributions of individuals.
In order to provide a fundamental standard to be expected in modern Linux distributions, the Linux Foundation designed the Filesystem Hierarchy Standard (FHS) to be used by distribution maintainers, package developers, and system implementers.
The FHS consists of a document that provides an overall outline and reference of the Linux directory structure. Although it is not intended as a fixed set of instructions, it represents the specifications on what to reasonably expect in the directory tree of a given distribution.
The main goal of the FHS is to ensure that software developers and system administrators can work across different distributions with a consistent understanding of where files and directories are located.
For example, according to the FHS, system binaries are typically stored in /bin
, user home directories in /home
, and configuration files in /etc
.
While most major distributions follow the FHS closely, some may have slight deviations based on design choices or specific use cases.
We will revisit this topic once we have learned the basic commands that are needed to navigate a Linux system.
What is the Shell?
A shell is a program that accepts commands and gives them to the operating system to be executed. In other words, the shell provides an interface layer between the Linux kernel and the end user.
Often used interchangeably, a terminal is a program that allows us to interact with the shell.
For example, when you open a terminal window on Linux or macOS, you're usually using a shell like bash or zsh. You can type commands like ls
, cd
, or mkdir
, and the shell interprets those and passes them to the kernel to carry out.

When we first start a terminal, it presents a command prompt (also known as the command line), which tells us that the shell is ready to start accepting commands from the user.
This prompt usually displays the username, hostname, and current working directory, followed by a special character (like $
for regular users or #
for the root user).
Linux provides a range of options for shells, the following being the most common:
- bash: Bash stands for Bourne Again SHell and is the default shell in most (if not all) modern Linux distributions. It incorporates tens of built-in commands and extensive documentation on how to use its wide variety of features. We will cover some of them in this book.
- sh: The Bourne SHell is the oldest shell and therefore has been the default shell of many UNIX-like operating systems for many years.
- ksh: The Korn SHell is a Unix shell developed by David Korn at Bell Labs in the early 1980s. It is backward-compatible with the Bourne shell and includes many features of the C shell.
Each shell has its own syntax and scripting capabilities, so understanding which one you are using can help when writing or troubleshooting shell scripts.
To open a terminal, simply go to the applications menu and select Terminal (or a similar name) from the list.