Skip to content

Practice: Understanding Linux

Module
Understanding Linux
Difficulty
Easy
Updated
On this page

A school’s computer club has received twelve donated laptops and one small computer that will store the club’s shared files. The club’s coordinator wants to install Linux on all of them on Saturday, and the students will then follow this course. Because you are learning Linux, the coordinator sends you the plan and asks: “Is this all right?”

Plan for Saturday

  1. We install Kali Linux on all twelve laptops. Security people use it, and its software is always up to date.
  2. On the file server, we install whichever Ubuntu release is available that day, and then we leave it alone for five years.
  3. Everyone signs in to one shared account, club, so that nobody forgets a password.
  4. Some laptops have only 4 GB of memory. We should buy more memory so that students can keep more files.
  5. Linux is free, so we cannot ask for a small fee to cover the USB sticks we copy it onto. That would break its license.
  6. If we change any program or setting on the laptops, the GPL says that we must publish our changes.
  7. Linux is a kind of Unix, like macOS. So the Mac in the school office already runs a Linux distribution.
  8. The kernel is the part with the windows and menus. GNOME Shell is where the students will type commands.

Each line sounds reasonable, and most of them are wrong in some way. You have no computer to test them on, and you do not need one. This practice puts all four lessons of the module to work: you check each line against what you learned, and you write the coordinator a reply that they can act on.

You may look back at the lessons while you work. Try each goal on your own first.

Reach these five goals. Each one uses one or more lines of the plan.

  1. You can tell the coordinator what memory and storage are each for, and what one shared account changes for the students’ files (lines 3 and 4).
  2. You can say whether the club may charge for the USB sticks, what the GPL asks of the club, and how Linux, Unix, and macOS are related (lines 5, 6, and 7).
  3. You can place each part of the software the club will install in the kernel, in user space, or in neither, and correct line 8.
  4. You can trace one click on Save, from a text editor on a student’s laptop down to the storage drive, through the parts of the system that handle it.
  5. You can recommend one distribution for the laptops and one for the file server, each with a reason from purpose, packages, or support, and say what is wrong with lines 1 and 2.

For goal 3, use this list of parts:

  • The code that keeps each program’s memory apart from the others.
  • GNOME Shell.
  • The program that shows the sign-in screen.
  • APT.
  • The code that checks a file’s permissions when a program asks to open it.
  • The choice of which programs a fresh Ubuntu installation contains.

When you are done, you have written:

  • For each of the eight lines: correct, or wrong, and one sentence of reason that names a concept from the module.
  • A table with the six parts from goal 3, each marked kernel, user space, or neither.
  • The path of one Save, as four to six steps in order, from the application to the storage drive.
  • Two recommendations, one for the laptops and one for the file server, each with a reason.

Open a hint only when you are stuck on that goal.

Hint for goal 1

Lesson B01.1 lists the four parts of the hardware and what each one keeps. Ask which one keeps data when the power is off. For the shared account, the Security Angle of lesson B01.1 describes two walls. Ask which wall depends on accounts.

Hint for goal 2

Lesson B01.2 has the four freedoms and a table of what the GPL asks. For line 5, check whether price appears in the four freedoms. For line 6, find the action that starts the GPL’s conditions. For line 7, find the words “Unix-like” and what they do not mean.

Hint for goal 3

Ask the same question as in lesson B01.3: does it run with full control of the hardware, in user mode, or is it not a program at all? For GNOME Shell, read its description in lesson B01.3 again, including the sentence that starts with “Despite the name”.

Hint for goal 4

Start with the diagram in lesson B01.3: where does a desktop application send its request, and where does the request go next? Then use lesson B01.1 for what the kernel does with a request to save a file.

Hint for goal 5

Use the three questions from lesson B01.4: purpose, packages, and support. For line 1, read what Kali’s own documentation says about who it is for. For line 2, ask when a release’s support period starts: on the day it is released, or on the day you install it.

Solution

Goal 1: memory, storage, and one shared account

Line 4 is wrong. Files are kept in storage, the drive that keeps data when the power is off. Memory holds the programs that are running and the data they are working on, and it loses its contents without power. More memory gives room for more running programs and their data. To keep more files, the laptops need more storage.

Line 3 is wrong. The OS checks a file’s permissions against the user account that a program runs for. With one shared account, every student’s files belong to the same account, so every student’s programs may open, change, and delete every other student’s files. Nothing separates one student’s homework from another’s.

The wall between programs in memory still stands: each running program has its own part of memory, whatever account it runs for. That wall protects programs, not students. One account per student restores the wall on files.

Goal 2: price, the GPL, and Unix

Line 5 is wrong. Free software means four freedoms: to run the program, to study and change it, to give copies to others, and to give copies of changed versions to others. Price is not one of them. The club may charge a fee for each USB stick, and the GNU project encourages people who give out copies of free software to charge for them.

What the GPL does ask is in the next step. When the club gives or sells copies to others, it distributes them, and the people who receive a copy must be able to get the complete source code of the GPL programs on it, under the GPL.

Line 6 is wrong. The GPL asks nothing while the club changes programs and uses them on its own laptops. Its conditions start only when the club distributes copies to other people. Changing a setting is not even a change to the program.

Line 7 is wrong. Linux is Unix-like: the Linux kernel was written from scratch to work like Unix, and it is not a version of Unix. macOS is Unix-like too, and it carries the UNIX trademark, but it does not use the Linux kernel. So macOS is not a Linux distribution, and the Mac in the office does not run Linux.

Goal 3: kernel, user space, or neither

Part Where it belongs Why
The code that keeps each program’s memory apart Kernel Memory management is a service of the kernel
GNOME Shell User space It is the main program of the desktop
The program that shows the sign-in screen User space The kernel does not show a login screen; programs in user space do
APT User space It is the package manager, a program that runs in user mode
The code that checks a file’s permissions Kernel The kernel checks every request to open a file
The choice of which programs a fresh installation contains Neither It is one of the distribution’s defaults, a decision, not a program

Line 8 is wrong twice. The kernel has no windows or menus: the desktop, in user space, draws them. And GNOME Shell is not where students type commands. Despite its name, it is the program that draws the desktop. The students type commands into a shell such as Bash, which lesson B03.2 introduces.

Goal 4: one click on Save

  1. The student clicks Save in the text editor. The editor is a desktop application: the desktop started it, not a shell.
  2. The editor sends its request to the system libraries, such as the GNU C Library.
  3. The library makes a system call to the kernel. The editor runs in user mode, so it cannot work with the storage drive itself.
  4. The kernel checks the permissions: may the account the editor runs for write to this directory?
  5. The kernel’s file system decides where on the drive the file goes and records its name.
  6. The device driver for the storage drive turns that into commands the drive understands, and the kernel returns the result to the editor: saved, or an error.

If your steps are in a slightly different order, or you named the kernel’s work as one step, that is fine. What matters is that the request goes down from user space to the kernel through a system call, and that only the kernel works with the hardware. Remember that the diagram in lesson B01.3 is a simplified model: a program can also make a system call without the C library.

Goal 5: two recommendations

Line 1 is wrong. Kali Linux is built for one job, penetration testing and security auditing. Its own documentation says it is not recommended for someone unfamiliar with Linux, or for someone who wants a general-purpose desktop. It is also a rolling release, so twelve laptops installed on different days, or updated at different times, would not even match each other.

For the laptops: Ubuntu 24.04 LTS, Desktop edition.

  • Purpose: it is a general-purpose distribution with a desktop, which fits learning.
  • Support: an LTS release receives five years of standard security maintenance, and its software stays at the same versions while the students learn.
  • It is the reference system of this course, so the students’ screens match the lessons. That is the reason to choose this release for the laptops, even when Ubuntu’s download page offers an LTS release with a higher number. Its end of support, in May 2029, is the date to plan around.

Line 2 is wrong twice. The release available on a given day may be one of Ubuntu’s six-month releases, with only nine months of support. And even an LTS release is supported from the day it was released, not from the day you install it: Ubuntu 24.04 LTS receives standard security maintenance until May 2029, whatever day you install it. “Leave it alone” is also wrong: fixes reach the server only if someone installs the updates, and an updated kernel runs only after a restart.

For the file server: a fixed release with long support. An Ubuntu LTS release or Debian stable both fit, and both are in the same family as the laptops: the same package format, deb, and the same package manager, APT, so the club needs one set of skills. A member of the Red Hat family, such as AlmaLinux or Rocky Linux, would also be a sound choice for a server, at the cost of a second set of commands. The server does not have to match the course, so the club can take the release in that family with the most support left on the day it installs. Whatever the club chooses, it looks up the end-of-support date before installing, and plans the upgrade to the following release before that date.

Your reply to the coordinator: Install Ubuntu 24.04 LTS on the laptops, and an Ubuntu LTS release or Debian stable on the file server, and install their updates. Give every student their own account. Buy storage, not memory, for more files. You may charge for the USB sticks, but the students must be able to get the source code of the GPL programs on them. Changes you keep on your own laptops do not have to be published. The Mac does not run Linux, and students type commands into a shell such as Bash, not into GNOME Shell.

Answer each question without looking back, then open the answer.

1. A laptop has 8 GB of memory and 256 GB of storage. Which one holds a document you saved yesterday, and which one holds the web browser while you use it?

Answer

Storage holds the saved document; it keeps data without power. Memory holds the running browser and the data it works on; that is lost when the power goes off, unless a program saved it to a file.

2. A program in user space wants to read a file. Why can it not read the storage drive itself, and what does it do instead?

Answer

Programs in user space run in user mode, and code in user mode may not work with the hardware. The program makes a system call, usually through a function of the C library, and the kernel reads the file for it, if the file’s permissions allow it.

3. A friend says: “Open source just means that I can read the code.” What is missing from that description?

Answer

The Open Source Definition says that open source “doesn’t just mean access to the source code”. The license must also let you change the program and give copies to others, and it may not forbid selling copies. The Free Software Definition requires these too.

4. Debian’s installation guide says “GNU/Linux”, and Ubuntu says “Linux” for the whole system. Is one of them wrong?

Answer

No. Strictly, Linux is the kernel, and much of the rest of the system comes from the GNU project, which is why the GNU project and Debian say GNU/Linux. Ubuntu, and this course, call the whole system Linux. The two names describe the same kind of system.

5. The support period of a release ends. Does the system stop working? What changes?

Answer

It keeps running. But flaws found after that date are no longer fixed for that release, so the system stays open to every flaw that is published after the end of support.

6. A rolling release suits a security workstation for some users, but not a server that should work the same way for years. Why?

Answer

A rolling release updates its packages continuously, so each tool arrives soon after its developers release it. That is useful for a toolbox that must keep up, and a problem for a server, where every update can change how a service behaves. A fixed release keeps software at the same versions and only adds fixes.

  • An operating system shares the hardware between applications: memory holds what runs, storage keeps files, and permissions are checked against the account a program runs for.
  • Free software is about liberty, not price. The GPL’s conditions start when you distribute copies. Unix-like systems are not all Linux.
  • The kernel runs in kernel mode; everything else runs in user space and reaches the hardware through system calls. Defaults and support are part of a distribution, but not programs.
  • Choose a distribution by purpose, packages, and support, and count support from the release, not from the day you install.

Next, module B02 starts with VM, WSL, live media, and bare metal (B02.1). The module installs Ubuntu 24.04 LTS in a virtual machine, the lab you use for the rest of the course.