Al-Siraj University · Technical College of Engineering · Cybersecurity Engineering Techniques

Week 1 — Introduction to Linux

CSTE2103 — Linux Fundamentals · Level 2 · Semester 3
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
What is in this page
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

1. What You Will Learn Today

After this session you will be able to:

  1. Say in your own words what an operating system does.
  2. Tell the short story of Linux: who made it and why.
  3. Explain the difference between the kernel and a distribution (like Ubuntu).
  4. Read the Linux file system and know what lives in /home and /etc.
  5. Open a terminal and run your first commands — you will practise them inside this page.

2. What Is an Operating System?

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.

Think of a restaurant. The kitchen is the hardware. The customers are the programs. The manager is the operating system: he takes every order, decides who is served first, keeps the customers from entering the kitchen, and makes sure nobody takes someone else's food.
YOUR PROGRAMS — browser, editor, games, security tools OPERATING SYSTEM Shares the CPU between programs Gives memory to each program Stores files on the disk Controls devices and permissions HARDWARE — CPU, memory, disk, network card

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.

Why this matters for us. The operating system decides who is allowed to do what. Most attacks on a computer are attacks on these decisions: someone convinces the system that he is allowed to do something he should not. This is why a cybersecurity student must understand the operating system first.

3. Watch Before You Read Further

Two short introductions. Watch the Arabic one if the English is difficult — the ideas are the same.

Video 1 — Linux explained in Arabic (شرح نظام لينكس للمبتدئين)
▶ Open on YouTube if the video does not appear — KernCore
Video 2 — Introduction to Linux, full beginner course (English)
▶ Open on YouTube if the video does not appear — freeCodeCamp.org. Watch the first 30 minutes only for this week.

4. The Story of Linux in Four Steps

1969 UNIX is born Bell Labs, USA 1983 GNU free tools but no kernel yet 1991 Linux kernel by Linus Torvalds Today everywhere servers, phones
1969 — UNIX

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.

1983 — GNU

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.

1991 — The Linux kernel

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.

Today

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.

What does "free software" mean?

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):

1. USE Run it for any purpose, free 2. STUDY Read the source code yourself 3. SHARE Give copies to anyone you want 4. IMPROVE Change it and publish your work
Remember this one sentence. "Linux" is only the engine. When people say "I installed Linux", they really installed a complete car built around that engine.

5. Kernel and Distribution

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.

Kernel the engine (Linux) + Programs shell, editor, file commands + Installer & store setup screen and package manager = Distribution Ubuntu, Fedora, Debian, Kali … ready to install Same engine inside every one of them — different tools, colours and update rules.

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:

UNIX ideas (1969) GNU + Linux kernel (1991) Debian (1993) Red Hat (1995) SUSE Arch Ubuntu Kali Linux Mint Fedora RHEL Rocky, Alma Manjaro openSUSE
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.

6. Where Linux Is Running Right Now

You may not see Linux on your own laptop, but you use it every day without knowing.

Web servers most of the internet Android phones built on the kernel Routers & TVs smart devices Supercomputers all top 500 of them
Security tools for scanning networks, testing systems and reading evidence are written for Linux first. An engineer who can use only the mouse is limited to tools that other people prepared. This course removes that limit.

7. Four Rules Linux Follows

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.

8. What Happens When You Press Enter

You type ls and the answer appears immediately. In that half-second, five things happen:

1. YOU type ls and press Enter 2. SHELL reads the line finds the program 3. KERNEL checks: are you allowed to read? 4. HARDWARE the disk sends the file names 5. the answer travels back the same way student@cste-lab:~$ ls Documents Downloads hello.txt notes.txt

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).

9. A First Look at the File System

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.

/ the beginning of the tree /bin /etc /home /var /tmp /usr /home/student ← your folder ( ~ ) Documents Downloads notes.txt A full address is written from the top: /home/student/notes.txt Linux uses the forward slash / — never the Windows backslash \
Folder What is inside it
/homeOne folder for each user. Your files live in /home/<your name>, written for short as ~.
/etcAll the settings of the system, written as normal text files you can read. This is the first place an administrator looks.
/binThe programs themselves — ls, cat and the others you are learning.
/varThings that grow while the machine works — above all the log files in /var/log. In security work you will live in this folder.
/tmpTemporary files. Everything here is deleted when the machine restarts.
/usrThe 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 ~.

10. Who Is "root"?

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.

Normal user (you) prompt ends with $ ✓ read and change your own files ✓ run normal programs ✗ change the settings in /etc ✗ install software or delete the system If you make a mistake, only your own files suffer. root (administrator) prompt ends with # ✓ everything a normal user can do ✓ change any file of any user ✓ install, remove, restart, destroy ! the system never says "are you sure?" One wrong letter here can destroy the machine.

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.

A small but useful detail. When Linux asks for your password, nothing appears on the screen while you type — no stars, no dots. The machine is not frozen and your keyboard is not broken. Type the password and press Enter.

11. Your First Commands

The line waiting for you in the terminal is called the prompt. It already tells you three things before you type anything:

Terminal student@cste-lab:~$ whoami student _ student — your user name cste-lab — the machine name ~ — the folder you are in (home) $ — normal user  (# means root)

A command has up to three parts. Understand this and you can read any command in the book:

ls -l /etc
▲  ▲  ▲
the command — what to do
    the option — how to do it (always starts with -)
        the target — on what (a file or a folder)

Now the commands themselves. Read what each one answers:

$ whoami # who am I?
$ hostname # host + name: what is this computer called?
$ pwd # print working directory
$ ls # list: what is inside this folder?
$ ls -l # the same, with size, date and owner
$ cd /etc # change directory
$ cd .. # go one step back
$ cat notes.txt # concatenate: print a file
$ date # what is the time?
$ uname -r # unix name: which kernel version?
$ df -h # disk free
$ man ls # manual page — press q to leave
Three tips that save you time.
  1. Press the Tab key and Linux completes the word for you. Use it always — it also protects you from typing mistakes.
  2. Press the Up arrow to bring back the command you typed before.
  3. Big and small letters are different: File.txt is not file.txt.

12. Practice Terminal

Do not wait for the laboratory. Try the commands right here, and finish the seven missions before the class.

Practice Terminal — Try the Commands Now

This is a safe copy of a Linux terminal that runs inside this page. Nothing here touches a real computer, so you cannot break anything. Type a command and press Enter. Start by typing help.
Your 7 missions
0 / 7 finished
student@cste-lab: practice terminal
student@cste-lab:~$
Tab = complete the word  ·  Up / Down arrows = commands you typed before  ·  clear = clean the screen  ·  help = the list of commands

13. Command Card — Week 1

Print this table and keep it beside you during the laboratory.

Command What it does Example
whoami
who am I
Shows your user namewhoami
hostname
host name
Shows the name of the computerhostname
pwd
print working directory
Shows the folder you are in nowpwd
ls
list
Lists what is inside the folderls /etc
ls -l
list, long
Same list with size, date and ownerls -l
cd
change directory
Moves you to another foldercd /home
cd ..
change directory, up
Goes one step backcd ..
cat
concatenate
Prints what is written inside a text filecat notes.txt
mkdir
make directory
Creates a new foldermkdir lab1
touch
touches the time stamp
Creates a new empty filetouch report.txt
date
date
Shows date and timedate
uname -r
unix name, release
Shows the kernel versionuname -r
df -h
disk free, human-readable
Shows free space on the diskdf -h
free -h
free memory
Shows how much memory is usedfree -h
history
history
Lists the commands you typed beforehistory
man
manual
Opens the help page (press q to leave)man cat
clear
clear
Cleans the screenclear
exit
exit
Closes the terminalexit

14. Mistakes Everybody Makes in the First Week

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.

15. Small Dictionary of This Week

Word Meaning in one line
KernelThe engine of the system; the only part that touches the hardware.
DistributionA complete ready system built around the kernel — Ubuntu, Fedora, Kali.
TerminalThe black window where you write commands.
Shell (bash)The program that understands what you write and answers you.
PromptThe line that waits for you: user, machine, folder, and $ or #.
rootThe administrator, the user without limits. Also the top of the tree, /.
sudoThe 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 managerThe software store of the system: apt on Ubuntu, dnf on Fedora.
Virtual machineA computer that exists only as a program inside your real computer.
GPL / open sourceThe licence that gives you the right to use, read, share and change the program.

Where the command names come from

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
whoamiplain English: “who am I?”Your user name.
hostnamehost + nameThe name of the machine.
pwdprint working directoryThe folder you are standing in.
lslistLists what is inside a folder.
cdchange directoryMoves you to another folder.
catconcatenatePrints a file. The name is there because it can also join several files one after another.
mkdirmake directoryCreates a folder.
rmremoveDeletes — for ever, with no recycle bin.
dfdisk freeHow much space is left on the disks.
dudisk usageHow much space a folder is using.
unameunix nameInformation about the system and the kernel.
manmanualThe manual page of a command.
touchnot an abbreviationIt “touches” the time stamp of a file — and creates the file if it does not exist.
susubstitute userBecome another user.
sudosubstitute user, doRun this one command as another user — by default the administrator.
bashBourne Again SHellThe shell we use. A pun: it replaced sh, the shell Stephen Bourne wrote.
shshellThe original shell.

Other short names you will meet

Short name It stands for In one line
OSoperating systemThe program that turns hardware into a usable machine.
GNUGNU’s Not UnixA name that repeats itself — the project’s own joke. It wrote the programs around the kernel.
GPLGNU General Public LicenseThe licence that gives you the right to use, read, share and change the program.
CLIcommand-line interfaceWorking by typing commands instead of clicking.
VMvirtual machineA computer that exists only as a program inside your real computer.
rootthe root of the treeTwo meanings: the administrator, and the top of the file tree, written /.
/binbinariesThe programs themselves — ls, cat and the others.
/etchistorically “et cetera”The folder of everything else, which became the folder of all the settings.
/homehomeOne folder for each user. Yours is written for short as ~.
/varvariableFiles that grow while the machine runs — above all the logs in /var/log.
/tmptemporaryDeleted when the machine restarts.
/usrhistorically the users’ folderToday: the programs installed with the system and their files.
/devdevicesDisks, 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.

16. Laboratory 1 — Install Linux and Say Hello to It

2 hours · each student alone · deliver one PDF · 10 marks

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.

YOUR REAL COMPUTER (Windows or macOS) VirtualBox — the program that creates the window Ubuntu Server — the virtual machine student@cste-lab:~$ whoami student
Watch this before you start (the exact steps, on screen)
▶ Open on YouTube if the video does not appear — LinuxTechi
What you need

VirtualBox (free), the Ubuntu Server file from the laboratory share, and a virtual machine with 2 CPUs, 2 GB memory and 25 GB disk.

Step 1 — Create the machine (about 30 minutes)
  1. Open VirtualBox and click New.
  2. Name it CSTE2103-<your number> and choose Linux → Ubuntu (64-bit).
  3. Give it 2 CPUs, 2 GB memory, 25 GB disk.
  4. Take a screenshot of the settings page.
Step 2 — Install Ubuntu (about 45 minutes)
  1. Start the machine and choose the Ubuntu file when it asks for a disk.
  2. Accept all the default answers.
  3. Write the computer name cste-lab and create a user with your own name. Write your password somewhere safe.
  4. When it finishes, restart and log in.
Step 3 — Meet your system (about 30 minutes)

Run these and take a screenshot of each answer. You already practised all of them in section 12.

$ whoami
$ hostname
$ pwd
$ ls /
$ uname -r
$ cat /etc/os-release
$ free -h
$ df -h
Two questions to answer in your report
  1. From uname -r: what is your kernel version?
  2. From cat /etc/os-release: what is the name and number of your distribution? In one line, explain why these two answers are different things.
Marks (10)
The machine is created and Ubuntu starts4
Screenshots of all eight commands4
The two questions answered2
Send one PDF named CSTE2103_Lab1_<your number>.pdf on IQ-LEARN before the next laboratory. Do not delete the virtual machine — we use it every week.

17. Check Yourself

Answer first, then click to open the answer. Not graded — but Quiz 1 in Week 5 looks like this.
Part A — Choose one answer
1. The word "Linux" by itself means: (a) a complete system   (b) the kernel only   (c) a company
(b) the kernel only — the engine. Ubuntu and Fedora are complete systems built around it.
2. Ubuntu belongs to which family? (a) Red Hat   (b) Arch   (c) Debian
(c) Debian — so it installs software with apt.
3. Which command shows the folder you are in? (a) ls   (b) pwd   (c) cd
(b) pwd. ls shows what is inside it, cd moves you somewhere else.
4. Your prompt ends with #. This means: (a) an error   (b) you are root   (c) the machine is busy
(b) you are root — the administrator. Linux will not stop you from doing anything, even deleting the system. Be careful.
5. You copied a file and saw no message. This means: (a) it failed   (b) it worked   (c) it is still copying
(b) it worked. Rule 4: no news is good news.
6. Where are the settings of the system kept? (a) /home   (b) /etc   (c) /tmp
(b) /etc — and they are normal text files, so you can read them with cat.
Part B — Answer in one or two lines
7. Your friend says "I installed Linux". What did he really install?
A distribution — for example Ubuntu. It contains the Linux kernel plus the programs, the installer and the software store. The kernel alone cannot be used.
8. Why do we say GNU/Linux and not only Linux?
Because the system is made of two halves: the GNU programs written from 1983, and the Linux kernel written in 1991. Together they make one working system.
9. What is the difference between the terminal and the shell?
The terminal is the window — it only shows letters and sends your keys. The shell (bash) is the program behind it that understands the command and answers.
10. In the command 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).
11. Why should you not work as root all the time?
Because root has no limits and the system never asks "are you sure?". One mistake can destroy the machine. Work as a normal user and use sudo only when you need it.
12. Name one place where Linux is used every day.
Web servers, Android phones, home routers, smart TVs, or the biggest supercomputers in the world — any of these is a correct answer.

18. Link to the Module Learning Outcomes

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.

19. Next Week and Extra Practice

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.

Books
  • Required: Nemeth, Snyder, Hein & Whaley, UNIX and Linux System Administration Handbook, 5th edition — read Chapter 1 only.
  • Easier to read: Shotts, The Linux Command Line — Introduction and Chapter 1.
If you want more video (optional)
A longer beginner course in English:
▶ Open on YouTube — Amigoscode
A full Arabic course (6 hours), useful all semester: دورة تعلم لينكس كاملة باللغة العربية — Ahmed Eid
CSTE2103 — Linux Fundamentals · Week 1 of 15 · Department of Cybersecurity Engineering Techniques