Linux
what it is, why it is used, and where everything livesLinux is an operating system kernel — the program between the hardware and everything else — and, loosely, the name for the whole systems built around it. It is free, open, and driven from a shell, and it keeps everything it has in one directory tree that starts at /.
One tree, starting at /. Know what lives where, and every command has somewhere to point.
What Linux is
The word is used for two things: the kernel alone, and a complete system you can install. These are the pieces that make up the second.
The one program that talks to the hardware. It shares the CPU between processes, hands out memory, drives the disks and network cards, and decides who may touch what. Strictly, this alone is Linux.
The program that reads what you type and runs it — usually bash. It is how you ask the kernel for things, and every command in this section is typed into one.
The small tools the shell runs: ls, cp, ps, ip. Most of the everyday ones come from the GNU project, which is why the whole system is sometimes called GNU/Linux.
A kernel, a userland, an installer and a package manager, assembled and maintained together. Ubuntu, Debian, Fedora, Arch and Kali are all Linux, packaged with different choices.
How software arrives: apt on Debian and Ubuntu, dnf on Fedora, pacman on Arch. One command fetches a program, everything it depends on, and later its updates.
A single tree that starts at / and holds everything — programs, settings, your files, even the devices. There are no drive letters; a second disk is just another branch.
Why it is used
Not because it is fashionable. It is what the machines behind a network actually run, and it lets you see and change how they work.
No licence to buy for one machine or ten thousand, and the source is there to read. When something behaves oddly, the answer is findable rather than hidden.
Most web servers and cloud machines, every supercomputer on the TOP500 list, and the kernel inside every Android phone. Working in IT means meeting it.
Many routers, firewalls and switches are Linux underneath. The ip, ss and tcpdump you learn on a laptop are the same tools on the box in the rack.
Settings live in plain files under /etc. They can be read, searched, compared, copied to another machine and kept in version control — no hidden registry.
Anything typed once can be saved and run again. A task done by hand on one server becomes a script that does it on a hundred.
Kali, and most tools for scanning, capturing and analysing, are built for Linux first. Permissions, users and logs are all in the open to inspect.
The directory tree
Everything hangs off one root, written /. The layout is the same on nearly every distribution, so learning it once is enough. The 18 directories under it do five jobs, and each job has its own colour — open any directory to see what it is for and what is inside.
- 1The system itselfPrograms, libraries and the kernel. Installed by the package manager — not somewhere to keep your own files.
- 2Configuration and changing dataThe settings, and everything that grows while the system runs: logs, caches, databases and what a server hands out.
- 3The peopleWhere users keep their own files — and, kept apart from them, the administrator.
- 4Windows into the kernelNot on any disk. The kernel makes these up as they are read: processes, hardware and devices, presented as files.
- 5Scratch space and mount pointsFiles that need not survive a reboot, and the empty directories where other disks are attached.
Writing a path
A path is the route to a file through the tree, with / between each step. Four spellings cover almost every one you will type.
cd /var/logAn absolute path starts with / and means the same place wherever you are standing.
cd Documents/notesA relative path has no leading / and is read from the directory you are in now.
cd ~The tilde is your home directory — /home/user for you, /root for the administrator.
cd ..Two dots mean the directory above; one dot means this one. Names are case-sensitive throughout.