Overview
Linux is a free, open-source operating system. It began in 1991 when Linus Torvalds released the Linux kernel, the core that manages a computer's hardware. Combined with tools from the GNU project and many others, it became a complete operating system.
Linux runs most of the world's web servers and cloud computing, all of the top supercomputers, Android phones, and countless devices such as routers and smart TVs. Learning Linux, especially its command line, is a core skill for programming, databases, web servers, and data science.
This guide explains Linux distributions, the safest ways for a beginner to install Linux, and a hands-on beginner example in the terminal.
Linux Distributions
A distribution ("distro") is a complete Linux operating system: the Linux kernel plus a package manager, a set of software, and usually a graphical desktop. All distributions share the same core commands, so what you learn in one carries over to the others.
| Distribution | Family | Package manager | Good for |
|---|---|---|---|
| Ubuntu | Debian | apt | Beginners, classes, servers, cloud. The most widely documented distribution, and the default in WSL. |
| Linux Mint | Debian / Ubuntu | apt | People coming from Windows who want a familiar desktop. |
| Debian | Debian | apt | Stable servers; the base that Ubuntu and Mint are built on. |
| Fedora | Red Hat | dnf | Developers who want newer software; related to Red Hat Enterprise Linux. |
| Red Hat Enterprise Linux (RHEL), Rocky Linux, AlmaLinux | Red Hat | dnf | Business and enterprise servers. |
| Arch Linux | Arch | pacman | Experienced users who want to build their system piece by piece. |
Many distributions also offer a long-term support (LTS) release that receives updates for years. For example, Ubuntu 26.04 LTS was released in April 2026 with five years of standard support. This guide uses Ubuntu, but the commands work on most distributions.
Ways to Install Linux
| Option | How it works | Risk to your files | Recommended for |
|---|---|---|---|
| WSL (Windows only) | Runs a real Linux distribution inside Windows, mainly through the terminal. | None | Windows users learning the command line. See the Windows WSL guide. |
| Virtual machine | Runs Linux as a "computer inside your computer" in an app such as VirtualBox or UTM. | None | Anyone who wants the full Linux desktop. Covered below. |
| Live USB | Boots Linux from a USB drive without installing it. | None, if you don't choose Install | Trying Linux on real hardware. |
| Dual boot / full install | Installs Linux on your computer's drive, next to or instead of your current system. | High if done incorrectly | Experienced users, or a spare computer. |
Requirements for a Virtual Machine
- At least 8 GB of RAM (16 GB is more comfortable), since Ubuntu 26.04 Desktop needs about 6 GB on its own.
- At least 30 GB of free disk space.
- Hardware virtualization enabled in your computer's UEFI/BIOS settings (usually on by default).
- Administrator privileges to install the virtual machine app.
Install Ubuntu in a Virtual Machine
Choose the tab for your computer:
Installing Ubuntu in a Virtual Machine
Complete your computer's tab first, then the Ubuntu Setup tab. Plan on 45–60 minutes, most of it waiting for downloads and the installer.
The guide covers these major tasks:
- Download the Ubuntu installer image (ISO).
- Install a virtual machine app.
- Create a virtual machine.
- Install Ubuntu inside it.
- Update Ubuntu.
Beginner Example: Working in the Terminal
The terminal (or shell) is a text window where you type commands. Linux's default shell is usually Bash. Open the Terminal and try the commands below, one at a time. Text after # is a comment explaining the command; you don't need to type it.
Step 1: Find your way around
whoami # show your username
pwd # print the folder you are in (your home folder)
ls # list the files and folders here
ls -l # list them with details (size, date, permissions)
cd Documents # change into the Documents folder
cd .. # go back up one level
cd ~ # go back to your home folder
Step 2: Create folders and files
mkdir linux-practice # make a new folder
cd linux-practice # move into it
echo "Hello, Linux!" > hello.txt # create a file containing one line
echo "Second line" >> hello.txt # add another line to the end
cat hello.txt # display the file's contents
cp hello.txt copy.txt # copy a file
mv copy.txt notes.txt # rename (move) a file
ls -l # see the results
Notice that > replaces a file's contents, while >> adds to the end.
Step 3: Install software with the package manager
The tree command shows folders as a tree. It usually isn't installed by default, so install it with apt:
sudo apt install tree -y # enter your password when asked
tree ~/linux-practice
Step 4: Write and run a shell script
A shell script is a text file of commands. Create one with the built-in nano text editor:
nano hello.sh
Type the following into nano:
#!/bin/bash
echo "Hello, $USER!"
echo "Today is $(date +%A)."
echo "You have $(ls | wc -l) items in this folder."
Press Ctrl + O then Enter to save, and Ctrl + X to exit nano. Then make the script executable and run it:
chmod +x hello.sh
./hello.sh
Example output:
Hello, student!
Today is Tuesday.
You have 3 items in this folder.
ls -l in your linux-practice folder shows hello.txt, notes.txt, and hello.sh, and ./hello.sh prints three lines.
Useful Tips
- Press Tab to auto-complete file and folder names.
- Press the Up arrow to bring back previous commands.
- Type
man ls(ormanfollowed by any command) to read its manual. Press q to quit. rmdeletes files permanently; there is no Recycle Bin or Trash in the terminal.
Next Steps
- Linux is a free, open-source operating system that comes in many distributions.
- Ubuntu is a good first distribution, and its commands carry over to most others.
- Learn Linux safely with WSL or a virtual machine before attempting a full installation.
- Use
sudoonly when needed, and double-check commands that delete files.