Learn Linux From Zero.
A practical Linux tutorial designed to help you understand the Linux operating system, terminal commands, file systems, networking, security and Bash scripting.
Linux Fundamentals
Understand Linux, distributions, the kernel, terminal and Linux architecture.
Terminal Skills
Learn essential commands for managing files, users, processes and systems.
Linux Security
Learn permissions, SSH, firewalls and basic security practices.
Introduction to Linux
What Linux is and why it is important.
Linux is an open-source operating system kernel. Operating systems such as Ubuntu, Debian, Fedora and Arch use the Linux kernel as their core.
What is Linux?
Linux is widely used on servers, cloud infrastructure, supercomputers, embedded systems, networking devices and personal computers.
Popular Linux Distributions
- Ubuntu
- Debian
- Fedora
- Arch Linux
- Linux Mint
- Rocky Linux
- AlmaLinux
Installing Linux
Ways to run Linux on your computer.
Linux can be installed directly on a computer, inside a virtual machine, or used through a live USB.
Common Options
- Install Linux alongside Windows using dual boot.
- Run Linux inside VMware or VirtualBox.
- Boot Linux from a USB drive.
- Use a cloud Linux server.
- Use Windows Subsystem for Linux (WSL).
Linux File System
Understand how Linux organizes files.
Linux uses a hierarchical file system. Everything begins
from the root directory represented by /.
| Directory | Purpose |
|---|---|
| / | Root of the entire file system |
| /home | User home directories |
| /etc | System configuration files |
| /var | Logs and variable data |
| /tmp | Temporary files |
| /usr | User programs and libraries |
| /bin | Essential commands |
| /dev | Device files |
Basic Terminal Commands
The commands you should learn first.
pwd
Displays your current directory.
$ pwd
ls
Lists files and directories.
$ ls
Documents Downloads Music Pictures
cd
Changes the current directory.
$ cd Documents $ pwd
Files and Directories
Create, copy, move and delete files.
Create a directory
$ mkdir myfolder
Create a file
$ touch file.txt
Copy a file
$ cp file.txt backup.txt
Move or rename a file
$ mv file.txt documents/
Remove a file
$ rm file.txt
File Permissions
Control who can read, write and execute files.
Linux permissions are generally divided into three groups: owner, group and others.
| Permission | Meaning | Value |
|---|---|---|
| r | Read | 4 |
| w | Write | 2 |
| x | Execute | 1 |
View permissions
$ ls -l
Change permissions
$ chmod 755 script.sh
Users and Groups
Manage accounts on Linux systems.
Show current user
$ whoami
Create a user
$ sudo adduser username
Change user
$ su username
Package Management
Install and update Linux software.
Debian and Ubuntu commonly use the APT package manager.
Update package information
$ sudo apt update
Upgrade packages
$ sudo apt upgrade
Install software
$ sudo apt install nginx
Processes
Monitor and manage running programs.
View processes
$ ps aux
Live process monitor
$ top
Stop a process
$ kill PID
Linux Networking
Understand network interfaces and connections.
Show IP information
$ ip addr
Test connectivity
$ ping google.com
View network routes
$ ip route
SSH
Securely connect to another Linux machine.
SSH stands for Secure Shell. It allows administrators and developers to remotely access Linux systems.
Connect to a server
$ ssh username@192.168.1.100
Copy a file using SCP
$ scp file.txt username@server:/home/username/
Services and systemctl
Manage background services on Linux.
Check service status
$ systemctl status nginx
Start a service
$ sudo systemctl start nginx
Enable service at boot
$ sudo systemctl enable nginx
Bash Scripting
Automate tasks using shell scripts.
Bash scripts allow you to combine Linux commands into reusable programs.
Simple Bash script
#!/bin/bash echo "Hello Linux!" NAME="Student" echo "Welcome, $NAME"
Run the script
$ chmod +x script.sh $ ./script.sh
Firewall with UFW
Control incoming and outgoing network traffic.
UFW (Uncomplicated Firewall) provides a simpler interface for managing firewall rules on many Ubuntu systems.
Check firewall status
$ sudo ufw status
Allow SSH
$ sudo ufw allow ssh
Enable firewall
$ sudo ufw enable
Linux Security Basics
Essential practices for keeping a Linux system safer.
1. Keep software updated
$ sudo apt update $ sudo apt upgrade
2. Use strong passwords
Avoid predictable passwords and use unique credentials for important accounts.
3. Understand sudo
The sudo command allows an authorised user
to execute commands with elevated privileges.
4. Limit unnecessary services
Services that are not required should generally be disabled or restricted.
Linux Knowledge Quiz
Test what you have learned.