```html Linux Tutorial | Learn Linux
LINUX TUTORIAL • BEGINNER → ADVANCED

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.

01

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.

Remember: Linux itself is technically the kernel. A complete Linux operating system is commonly called a Linux distribution.

Popular Linux Distributions

02

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

  1. Install Linux alongside Windows using dual boot.
  2. Run Linux inside VMware or VirtualBox.
  3. Boot Linux from a USB drive.
  4. Use a cloud Linux server.
  5. Use Windows Subsystem for Linux (WSL).
Warning: When installing Linux alongside another operating system, always back up important files before changing disk partitions.
03

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
04

Basic Terminal Commands

The commands you should learn first.

pwd

Displays your current directory.

Terminal
$ pwd

ls

Lists files and directories.

Terminal
$ ls
Documents  Downloads  Music  Pictures

cd

Changes the current directory.

Terminal
$ cd Documents
$ pwd
05

Files and Directories

Create, copy, move and delete files.

Create a directory

Terminal
$ mkdir myfolder

Create a file

Terminal
$ touch file.txt

Copy a file

Terminal
$ cp file.txt backup.txt

Move or rename a file

Terminal
$ mv file.txt documents/

Remove a file

Terminal
$ rm file.txt
Be careful with rm. Deleted files may not be recoverable through normal Linux commands.
06

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

Terminal
$ ls -l

Change permissions

Terminal
$ chmod 755 script.sh
07

Users and Groups

Manage accounts on Linux systems.

Show current user

Terminal
$ whoami

Create a user

Terminal
$ sudo adduser username

Change user

Terminal
$ su username
08

Package Management

Install and update Linux software.

Debian and Ubuntu commonly use the APT package manager.

Update package information

Ubuntu / Debian
$ sudo apt update

Upgrade packages

Ubuntu / Debian
$ sudo apt upgrade

Install software

Ubuntu / Debian
$ sudo apt install nginx
09

Processes

Monitor and manage running programs.

View processes

Terminal
$ ps aux

Live process monitor

Terminal
$ top

Stop a process

Terminal
$ kill PID
10

Linux Networking

Understand network interfaces and connections.

Show IP information

Terminal
$ ip addr

Test connectivity

Terminal
$ ping google.com

View network routes

Terminal
$ ip route
11

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

Terminal
$ ssh username@192.168.1.100

Copy a file using SCP

Terminal
$ scp file.txt username@server:/home/username/
12

Services and systemctl

Manage background services on Linux.

Check service status

Terminal
$ systemctl status nginx

Start a service

Terminal
$ sudo systemctl start nginx

Enable service at boot

Terminal
$ sudo systemctl enable nginx
13

Bash Scripting

Automate tasks using shell scripts.

Bash scripts allow you to combine Linux commands into reusable programs.

Simple Bash script

script.sh
#!/bin/bash

echo "Hello Linux!"

NAME="Student"

echo "Welcome, $NAME"

Run the script

Terminal
$ chmod +x script.sh
$ ./script.sh
14

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

Terminal
$ sudo ufw status

Allow SSH

Terminal
$ sudo ufw allow ssh

Enable firewall

Terminal
$ sudo ufw enable
If you are connected remotely over SSH, make sure SSH access is allowed before enabling a firewall.
15

Linux Security Basics

Essential practices for keeping a Linux system safer.

1. Keep software updated

Ubuntu / Debian
$ 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.

Important: Never run commands from the internet as root unless you understand exactly what the command does.
?

Linux Knowledge Quiz

Test what you have learned.

1. Which command displays your current directory?
2. Which command is commonly used to change directories?
3. Which permission represents execute?
4. Which command is used to connect to a remote Linux machine securely?
```