Linux tutorials
Linux is a free, Unix-like operating system that runs most of the world's servers, cloud machines, and containers, as well as many desktops and embedded devices. It is administered mainly from the command line: a shell such as Bash reads commands, runs programs, and connects them with pipes, so that small tools that each do one job can be combined into powerful one-liners and scripts.
About these tutorials
The tutorials cover the everyday commands for working with files, text,
processes, disks, users, services, and networks, and the Bash features used
in shell scripts. Most of the commands come with every common distribution;
a few, such as jq, xh, and monk, are installed separately. The examples are
run on Debian and Ubuntu systems. Commands that change the
system, such as managing users or services, need administrator rights and are
run with sudo.
Getting started
Basic Linux commands is a tour of the most common commands in the shell. File permissions explains the read, write, and execute bits for the owner, group, and others. Redirection and pipes connects commands through standard input, output, and error, and covers here documents, here strings, and process substitution.
Files and directories
ls lists directories and cd moves between them. mkdir and touch create directories and files, and cp, mv, and rm copy, move, rename, and delete them. ln creates hard and symbolic links, find searches directory trees, and stat and file show inode metadata, timestamps, and file types. chmod and chown change permissions and ownership.
Viewing and processing text
cat, less, and head and tail display files and parts of them, and echo prints text. grep searches for patterns and the sed stream editor substitutes, deletes, and inserts lines. cut, tr, sort, uniq, and wc select fields, translate characters, sort, remove duplicates, and count, and tee copies a stream to files. diff and patch compare files and apply changes, od dumps binary data, and jq filters and transforms JSON.
Archives and compression
tar packs directories into archives and extracts them, gzip and xz compress single files and test their integrity, and zip creates archives that can be opened on any system.
Bash and shell scripting
Environment variables covers
export, PATH, and .env files.
Shell expansion explains brace, tilde,
parameter, command, and arithmetic expansion and globbing, and
quoting controls word splitting.
Conditionals and
loops are the building blocks of scripts, and
exit codes shows how commands report success and
how set -euo pipefail stops a script on errors.
Job control runs commands in the background,
aliases and .bashrc customize the shell, and
xargs builds command lines from input.
Processes and system monitoring
ps lists processes and top and htop watch them live, and kill sends them signals. free, uptime, and vmstat report memory usage, load averages, and CPU and disk activity, and lsof finds which process uses a file or port.
Disks and file systems
df shows free space on file systems and
du finds what takes up the space.
mount and lsblk list disks, create and mount
file systems, mount disk images, and configure /etc/fstab.
Users, services, and scheduling
sudo runs commands as root or another user, passwd manages passwords, and useradd and usermod create users and manage groups. systemctl starts, stops, and enables services, journalctl reads their logs, and cron runs jobs on a schedule.
Networking
ip shows interfaces, addresses, and routes, and ss lists listening ports and connections. ping and traceroute test reachability and the path to a host, dig and nslookup query DNS, and nc checks ports and talks to services by hand. ssh logs in to remote machines with keys and forwards ports, and scp and rsync copy and synchronize files between them.
Web and HTTP tools
curl sends HTTP requests and wget downloads files and whole sites. xh is a fast HTTPie-compatible client with friendly JSON support, and monk selects elements from HTML pages with CSS selectors.
Date and time
date prints and formats the current date and time and calculates other dates, and cal displays calendars.
The output of some commands, such as version numbers, paths, and package names, may differ slightly on other distributions.
last modified November 25, 2026