| Class time 2 h lecture + 2 h lab |
Study at home about 3 h |
Outcomes LO 1 (start of 2, 4, 11) |
Needed before Nothing |
| 1. What you will learn 2. What is an operating system 3. Two videos to watch 4. The story of Linux 5. Kernel and distribution 6. Where Linux is running 7. Four rules Linux follows |
8. What happens when you press Enter 9. A first look at the file system 10. Who is root? 11. Your first commands 12. Practice terminal (try it here) 13. Command card |
14. Mistakes everybody makes 15. Small dictionary + abbreviations 16. Laboratory 1 17. Check yourself 18. Learning outcomes 19. Next week and extra videos |
After this session you will be able to:
/home and /etc.A computer is only metal, plastic and electricity. It cannot do anything on its own. The operating system (OS) is the program that makes the hardware useful.
Inside the operating system there is one small program that is more important than all the others: the kernel. It is the only part allowed to touch the hardware directly. Everything else must ask the kernel politely. Keep this word in your head — we use it all semester.
Two short introductions. Watch the Arabic one if the English is difficult — the ideas are the same.
Engineers at Bell Labs in America built an operating system called UNIX. It was simple, clean and easy to move from one computer to another. Almost everything we use today — files, folders, permissions, the command line — started there. UNIX was not free: companies had to pay a lot of money for it, and they could not see how it worked inside.
Richard Stallman started a project called GNU to build a free copy of UNIX — free to use, to read and to change. His team wrote most of the programs: the compiler, the editor, the shell, the file commands. But they did not finish the most important part: the engine.
A student in Finland, Linus Torvalds, wrote that missing engine as a hobby in his room and shared it on the internet for free. The engine is called the kernel. GNU programs + the Linux kernel = a complete free system. People all over the world started to improve it together.
Thousands of engineers from companies that compete with each other work on the same kernel. Anyone — including you — can download the source code, read it and change it.
It does not only mean "no price". It means you receive four rights with the program, protected by a licence called the GPL (GNU General Public License):
You never install the kernel alone. You install a ready package called a distribution (or "distro"). A distribution is the kernel plus everything else you need, prepared by a team and ready to use.
All the distributions you hear about come from a small number of families. A distribution copies its parent and changes some things — like a family tree:
| Family | Examples | Install command | Used mostly for |
|---|---|---|---|
| Debian | Ubuntu, Debian, Mint, Kali | apt install | Servers, students, security work |
| Red Hat | RHEL, Fedora, Rocky, AlmaLinux | dnf install | Big companies, banks, certificates |
| SUSE | openSUSE, SUSE Enterprise | zypper install | European industry, large systems |
| Arch | Arch Linux, Manjaro | pacman -S | Advanced users who want the newest |
In our laboratory we use Ubuntu Server. Do not worry about choosing between them now — Week 2 is only about this.
You may not see Linux on your own laptop, but you use it every day without knowing.
If you remember these four rules, much of the course will feel natural.
| 1. Each tool does one job | One command counts lines. Another sorts them. Nothing tries to do everything. |
| 2. Small tools join together | You connect them with the symbol | and build something powerful. We start this in Week 9. |
| 3. Everything looks like a file | Your documents are files. Your disk is a file. Even the keyboard is a file. So the same few commands work on everything. |
| 4. No news is good news | When a command works, it usually prints nothing at all. If you see a message, read it — it is telling you about a problem. |
You type ls and the answer appears immediately. In that half-second, five things happen:
Two new words appear in this picture:
| Terminal | The black window. It only shows letters on the screen and sends your keys inside. It is like a telephone. |
| Shell | The program that listens on the other side of the telephone, understands your words and answers. The most common one is called bash (Bourne Again SHell — it replaced the older sh). |
In Windows you have C: and D:. Linux has no letters. There is one single tree that starts at / — we call it "root", the beginning of everything. Every disk, every USB stick, every folder hangs somewhere on this tree.
| Folder | What is inside it |
|---|---|
| /home | One folder for each user. Your files live in /home/<your name>, written for short as ~. |
| /etc | All the settings of the system, written as normal text files you can read. This is the first place an administrator looks. |
| /bin | The programs themselves — ls, cat and the others you are learning. |
| /var | Things that grow while the machine works — above all the log files in /var/log. In security work you will live in this folder. |
| /tmp | Temporary files. Everything here is deleted when the machine restarts. |
| /usr | The programs that were installed after the system, and their files. |
Week 3 is dedicated to moving around this tree. For today, only remember: one tree, it starts at /, and your own place in it is ~.
Linux was built from the first day for many users on one machine. So every file belongs to somebody, and every user has limits. There is one user without limits, called root — the administrator.
The correct habit — the one every professional follows — is: work as a normal user, and borrow the power of root only for the one command that needs it. You borrow it with the word sudo (substitute user, do) in front of the command. We study this properly in Week 6.
The line waiting for you in the terminal is called the prompt. It already tells you three things before you type anything:
A command has up to three parts. Understand this and you can read any command in the book:
Now the commands themselves. Read what each one answers:
File.txt is not file.txt.Do not wait for the laboratory. Try the commands right here, and finish the seven missions before the class.
help.
clear = clean the screen · help = the list of commands
Print this table and keep it beside you during the laboratory.
| Command | What it does | Example |
|---|---|---|
| whoami who am I | Shows your user name | whoami |
| hostname host name | Shows the name of the computer | hostname |
| pwd print working directory | Shows the folder you are in now | pwd |
| ls list | Lists what is inside the folder | ls /etc |
| ls -l list, long | Same list with size, date and owner | ls -l |
| cd change directory | Moves you to another folder | cd /home |
| cd .. change directory, up | Goes one step back | cd .. |
| cat concatenate | Prints what is written inside a text file | cat notes.txt |
| mkdir make directory | Creates a new folder | mkdir lab1 |
| touch touches the time stamp | Creates a new empty file | touch report.txt |
| date date | Shows date and time | date |
| uname -r unix name, release | Shows the kernel version | uname -r |
| df -h disk free, human-readable | Shows free space on the disk | df -h |
| free -h free memory | Shows how much memory is used | free -h |
| history history | Lists the commands you typed before | history |
| man manual | Opens the help page (press q to leave) | man cat |
| clear clear | Cleans the screen | clear |
| exit exit | Closes the terminal | exit |
Read this list now and you will lose much less time in the laboratory.
| What you see | Why | What to do |
|---|---|---|
| Ls: command not found | Big letter. Linux is not Windows: Ls and ls are two different words. |
Write everything in small letters. |
| cd/etc: No such file | You forgot the space between the command and the target. | Always: command, space, target. |
| cat: Documents: Is a directory | cat reads files, not folders. |
Use ls for a folder, cat for a file. |
| No such file or directory | The file exists, but you are standing in another folder. | Type pwd and ls to see where you are. |
| $: command not found | You copied the $ from the book. It is not part of the command. |
Copy only what comes after the $. |
| Nothing appears while typing the password | This is normal — Linux hides even the number of letters. | Type it and press Enter. |
| The screen is full of text and does not answer | You are inside a manual page or a program that is still running. | Press q for a manual, or Ctrl + C to stop a program. |
| C:\Users\... does not work | Linux has no drive letters and uses /, not \. |
Write paths like /home/student. |
| Word | Meaning in one line |
|---|---|
| Kernel | The engine of the system; the only part that touches the hardware. |
| Distribution | A complete ready system built around the kernel — Ubuntu, Fedora, Kali. |
| Terminal | The black window where you write commands. |
| Shell (bash) | The program that understands what you write and answers you. |
| Prompt | The line that waits for you: user, machine, folder, and $ or #. |
| root | The administrator, the user without limits. Also the top of the tree, /. |
| sudo | The word you put before a command to borrow the power of root for that command only. |
| Home folder (~) | Your own folder, /home/<your name>, where your files live. |
| Option (flag) | A small letter after a command that changes how it works, like the -l in ls -l. |
| Package manager | The software store of the system: apt on Ubuntu, dnf on Fedora. |
| Virtual machine | A computer that exists only as a program inside your real computer. |
| GPL / open source | The licence that gives you the right to use, read, share and change the program. |
Nothing in Linux is named randomly. Almost every command is a shortened English word — once you know the word, you stop memorising the command.
| Command | The name means | What that tells you |
|---|---|---|
| whoami | plain English: “who am I?” | Your user name. |
| hostname | host + name | The name of the machine. |
| pwd | print working directory | The folder you are standing in. |
| ls | list | Lists what is inside a folder. |
| cd | change directory | Moves you to another folder. |
| cat | concatenate | Prints a file. The name is there because it can also join several files one after another. |
| mkdir | make directory | Creates a folder. |
| rm | remove | Deletes — for ever, with no recycle bin. |
| df | disk free | How much space is left on the disks. |
| du | disk usage | How much space a folder is using. |
| uname | unix name | Information about the system and the kernel. |
| man | manual | The manual page of a command. |
| touch | not an abbreviation | It “touches” the time stamp of a file — and creates the file if it does not exist. |
| su | substitute user | Become another user. |
| sudo | substitute user, do | Run this one command as another user — by default the administrator. |
| bash | Bourne Again SHell | The shell we use. A pun: it replaced sh, the shell Stephen Bourne wrote. |
| sh | shell | The original shell. |
| Short name | It stands for | In one line |
|---|---|---|
| OS | operating system | The program that turns hardware into a usable machine. |
| GNU | GNU’s Not Unix | A name that repeats itself — the project’s own joke. It wrote the programs around the kernel. |
| GPL | GNU General Public License | The licence that gives you the right to use, read, share and change the program. |
| CLI | command-line interface | Working by typing commands instead of clicking. |
| VM | virtual machine | A computer that exists only as a program inside your real computer. |
| root | the root of the tree | Two meanings: the administrator, and the top of the file tree, written /. |
| /bin | binaries | The programs themselves — ls, cat and the others. |
| /etc | historically “et cetera” | The folder of everything else, which became the folder of all the settings. |
| /home | home | One folder for each user. Yours is written for short as ~. |
| /var | variable | Files that grow while the machine runs — above all the logs in /var/log. |
| /tmp | temporary | Deleted when the machine restarts. |
| /usr | historically the users’ folder | Today: the programs installed with the system and their files. |
| /dev | devices | Disks, keyboards and screens, presented as files. |
You are not asked to memorise this table. Read it once and the commands stop looking like random letters.
We will not remove Windows from your computer. We will install Linux inside a window, using a program called VirtualBox. This window is called a virtual machine: a computer inside your computer. If something breaks, you delete it and start again — your real system is safe.
VirtualBox (free), the Ubuntu Server file from the laboratory share, and a virtual machine with 2 CPUs, 2 GB memory and 25 GB disk.
CSTE2103-<your number> and choose Linux → Ubuntu (64-bit).cste-lab and create a user with your own name. Write your password somewhere safe.Run these and take a screenshot of each answer. You already practised all of them in section 12.
uname -r: what is your kernel version?cat /etc/os-release: what is the name and number of your distribution? In one line, explain why these two answers are different things.| The machine is created and Ubuntu starts | 4 |
| Screenshots of all eight commands | 4 |
| The two questions answered | 2 |
CSTE2103_Lab1_<your number>.pdf on IQ-LEARN before the next laboratory. Do not delete the virtual machine — we use it every week.apt.ls (b) pwd (c) cdls shows what is inside it, cd moves you somewhere else.#. This means: (a) an error (b) you are root (c) the machine is busy/home (b) /etc (c) /tmpcat.ls -l /etc, name the three parts.ls is the command (what to do), -l is the option (how), /etc is the target (on what).sudo only when you need it.| Outcome | From the module description form | Covered by |
|---|---|---|
| LO 1 | Basic Linux knowledge — history, purpose, philosophy, differences between distributions | Sections 2–7, 15; questions 1, 2, 7, 8, 12 |
| LO 2 | Installing and configuring Linux systems | Laboratory steps 1–2 (started; finished in Week 2) |
| LO 3 | Navigating and manipulating the file system | Section 9; practice terminal missions 3, 4, 7 (first step) |
| LO 4 | Command-line operations, including system information queries | Sections 8, 11, 12, 13; laboratory step 3 |
| LO 11 | Security principles — user permissions and file security | Section 10; questions 4, 11 (first ideas only) |
This material is examined in Quiz 1 (Week 5), the midterm (Week 8) and the final examination.
Week 2 — Exploring Linux distributions. Which distribution to choose, and why companies choose a different one from students. Bring the virtual machine you installed today.