Linux is built around a powerful file system and command-line tools that give users full control over their environment. As a beginner, understanding the root user, root directory, and basic file-handling commands is an important first step. In this post, we’ll break these concepts down in a simple and practical way.
Root User vs Root Directory
Root User
The root user is the superuser in Linux. This account has unrestricted access to the entire system and can perform critical tasks such as:
- Installing and removing software
- Managing users and permissions
- Modifying system configuration files
You’ll often recognize the root user by the # symbol at the end of the command prompt. Because of its power, it should be used carefully to avoid damaging the system.
Root Directory (/)
The root directory is the top-level directory in the Linux file system, represented by /.
Every other directory branch from it, including:
- /home
- /etc
- /var
- /bin
It’s important to note that the root directory is not the same as the root user, one is a location, the other is a user account.
Using the cat Command
The cat command (short for concatenate) is commonly used to read, create, and merge files.
Reading a File
Example: cat ahmed.txt
This displays the content of the file directly in the terminal.

Creating a File with cat
Example: cat > lekan.txt
This allows you to type content into a new file.
Press Ctrl + D to save and exit.

Merging Files
Example: cat ahmed.txt lekan.txt > combinedfile.txt
This combines the contents of both files into a new file called combinedfile.txt.

Numbering Lines
Example: cat /etc/services -n
The -n option numbers each line, which is helpful when reading configuration files.

Without -n option, the files won’t be numbered

Reading Files and Logs in Linux
Using less
Example: less /etc/services
less is useful for viewing large files, it helps reduce the number of files displayed at once. You can scroll through the file and press q to quit.

Using head
Example: head /etc/services
Displays the first 10 lines of a file.

Using tail
Example: tail /etc/services
Displays the last 10 lines of a file, which is especially useful when checking logs.

Viewing a Specific Number of Lines
Example: head /etc/services -n 15

Example: tail -n 20 /etc/services

Creating Files in Linux
Using touch
Example: touch yemi.txt
Creates an empty file or updates the file’s timestamp if it already exists.

Using echo
Example: echo “Hello World” >adeyemi.txt
Creates a file and writes text into it.

Using >> appends text instead of overwriting the file.

Viewing File Information
Using stat
Example: stat ahmed.txt
This displays detailed information such as file size, permissions, and timestamps.

Verbose Mode in Linux Commands
Verbose mode shows detailed feedback about what a command is doing.
Example: mkdir -v yemi
This confirms the directory creation instead of running silently.

Mastering these basic Linux commands builds a strong foundation for system administration, DevOps, and cloud computing. Understanding how files work and how to view logs will make troubleshooting and system navigation much easier.

