Trainee Reference • UNIX/Linux Concepts

Conceptual Architecture of UNIX/Linux Systems

An animated, interactive explanation of the classic UNIX layers: hardware, kernel, system calls, libraries, shells, tools, and applications — plus five foundational operating system principles every trainee must understand.

MultiuserMultitaskingCase sensitiveIPCFile/process model
Original conceptual architecture screenshot

The document below recreates this layered idea interactively and expands it into trainee-ready notes, labs, and checks.

1. UNIX/Linux Architecture: the layered view

The screenshot shows a core UNIX idea: users and applications do not directly control the hardware. They normally move through layers. Applications call libraries, libraries and shells use system calls, the kernel enforces security and resource control, and the hardware executes the actual work.

Main conclusion: Linux is powerful because it separates responsibility. Hardware provides capability, the kernel controls access, system calls provide a controlled interface, and user-space tools combine small programs into bigger workflows.

Click a ring to learn the layer

Interactive UNIX/Linux architecture layers Concentric layers from application programs through shells, libraries, system calls, kernel, and hardware. Other application programs Application programs grep vi Shells, compilers, linkers bash gcc System libraries libc System call interface open read fork exec Kernel Hardware

Hardware

The physical or virtual machine: CPU, RAM, disks, network cards, keyboard, screen, and cloud/VM devices. The kernel hides hardware differences and presents consistent abstractions.

Command journey animation

Example: when a trainee runs ls -l /etc, the request travels through several layers.

User types command
Shell parses
Process starts
System calls
Kernel reads filesystem
Output returns
What the shell really does

The shell expands wildcards, variables, quotes, aliases, and redirections. Then it usually creates a child process and replaces that child with the requested program using the exec family of system calls.

2. Linux is a multiuser, multitasking operating system

Multiuser means many users can work safely on the same system

Linux was designed for shared systems. Multiple users can log in locally, over SSH, through terminal sessions, or through services. Each user has an identity, usually represented internally by a UID and one or more GIDs.

The kernel enforces who can read, write, execute, signal, or control resources. This is why one trainee can have files under /home/student1 while another has separate files under /home/student2.

ConceptMeaningUseful commands
User identityWho is running the commandwhoami, id
Logged-in usersCurrent user sessionswho, w
PermissionsAllowed actions on files/directoriesls -l, chmod, chown
Privilege elevationRun specific commands as another user, commonly rootsudo, su

Multitasking means many processes share CPU time

A Linux system may run hundreds or thousands of processes. The CPU can execute only a limited number of threads at the same instant, so the kernel scheduler rapidly switches between runnable tasks. This creates the practical effect that many programs run at once.

PID 101: sshd
PID 245: bash
PID 801: nginx
CPU
time slice
Important: multitasking is controlled sharing, not chaos. The scheduler decides which task gets CPU time. Memory management prevents normal processes from reading each other's private memory.

Beginner mental model

User

A person or service identity. Examples: root, jp, nginx, postgres.

Process

A running program with a PID. Example: one terminal shell, one web server worker, one backup script.

Permission boundary

The kernel checks whether that user/process can perform the requested operation.

3. UNIX/Linux is case sensitive

In Linux, uppercase and lowercase letters are different characters in file names, directory names, commands, usernames, variables, and many configuration values.

📄
Report.txtCapital R
📄
report.txtSmall r
Click the file names above. Linux treats them as two separate names.

Common mistakes trainees make

Wrong assumptionCorrect Linux behavior
Documents and documents are the sameThey can be two different directories.
PATH and path are the same variablePATH is commonly used by the shell. path is a different variable.
LS should run like lsCommand names are case sensitive. LS usually fails unless such a command exists.
Config values are always forgivingMany Linux tools treat names exactly as written.
Training rule: type carefully. Most Linux troubleshooting starts by checking exact spelling, case, path, permissions, and ownership.

4. IPC: Inter-Process Communication

Processes often need to cooperate. IPC is how one process sends data, events, or control messages to another process. The shell pipeline in ps aux | grep ssh is one of the easiest IPC examples for beginners.

IPC animation: Process A sends data to Process B

Process A

Producer, sender, writer, client, parent, or command before the pipe.

echo "error"

pipe/socket/signal/shared memory

Process B

Consumer, receiver, reader, server, child, or command after the pipe.

grep error
IPC trainer terminal
Click an IPC demo above.

IPC methods trainees should know

IPC typeExample
Pipescat file | grep error
Signalskill -TERM <pid>
SocketsWeb server, SSH, database connections
Shared memoryHigh-speed local communication
Message queuesStructured messages between processes
Files/locksSimple coordination through filesystem
Precise wording: IPC is not one command. It is a family of mechanisms for process-to-process cooperation.

5. Linux does not depend on filename extensions

Linux does not require a file to have an extension such as .txt, .sh, .log, or .conf. Extensions are mainly conventions used by humans and applications.

training-lab/ ├── backup ├── backup.txt ├── deploy ├── deploy.sh ├── nginx.conf └── notes.final.v2
Key point: Linux mainly cares about the file name, permissions, ownership, path, and file content. A file named script.txt can still run if it has executable permission and a valid interpreter line, although that naming would confuse humans.

How Linux decides what a file is

QuestionLinux/Unix behavior
Can a file have no extension?Yes. Example: /bin/ls, /etc/hosts, Makefile.
Can a file have many dots?Yes. Example: app.prod.backup.2026.
Does .sh make a script executable?No. Executable permission and interpreter/format matter.
How can I inspect type?Use file filename, ls -l, head, or application-specific tools.
Nuance: desktop environments and some applications may use extensions for convenience. The OS itself does not enforce Windows-style extensions as the identity of a file.

6. Everything is a file or a process: the Unix abstraction

Everything is a file: what it really means

UNIX popularized a clean abstraction: many resources can be accessed using file-like operations such as open, read, write, and close. This does not mean every resource is a regular text file. It means many things can be represented by file descriptors or filesystem entries.

ResourceWhere trainees see itMeaning
Regular files/etc/hostsStored data
Directories/var/logContainers of names
Devices/dev/sda, /dev/nullDevice interface
Pipes|, named FIFOsStream between processes
SocketsNetwork/service endpointsCommunication channel
Process info/proc/<pid>Kernel view of running process

Everything active is a process

A running program is represented as a process. A process has a PID, parent PID, owner, state, memory mappings, open files, environment, and command line.

Program file
/bin/bash
Loaded into memory
Running process
PID 245
Visible under
/proc/245
Important distinction

A file is stored data or an interface. A process is a running instance of a program. One program file can be used to create many processes. Example: many users can each run their own bash process from the same /bin/bash file.

Better phrase for trainees: Linux models resources as files where possible, and models running work as processes.

7. Hands-on labs

These labs are safe for a training VM. Run as a normal user unless a command explicitly says otherwise. Avoid running destructive commands on production systems.

Lab 1 — Multiuser and identity

whoami
id
who
w
ps -u "$USER" -o pid,ppid,user,stat,comm | head

# Optional on a lab VM with sudo access:
sudo useradd trainee1
sudo passwd trainee1
su - trainee1
whoami
exit
Expected learning

Trainees should see their username, UID/GID, login sessions, and processes owned by their user.

Lab 2 — Multitasking and jobs

sleep 300 &
jobs
ps -o pid,ppid,stat,comm -p $!
kill $!
jobs
Expected learning

The shell can start a background process. The kernel tracks it using a PID. A signal can request that it terminates.

Lab 3 — Case sensitivity

mkdir case-lab
cd case-lab
touch Report.txt report.txt REPORT.txt
ls -l
cat > Demo <<'EOF'
This is Demo
EOF
cat > demo <<'EOF'
This is demo
EOF
cat Demo
cat demo
cd ..
Expected learning

Linux treats differently cased names as different names.

Lab 4 — Filename extensions are conventions

mkdir extension-lab
cd extension-lab
cat > runme <<'EOF'
#!/bin/bash
echo "I have no .sh extension, but I can run."
EOF
chmod +x runme
./runme

cat > script.txt <<'EOF'
#!/bin/bash
echo "My extension says .txt, but I am still a shell script."
EOF
chmod +x script.txt
./script.txt
file runme script.txt
cd ..
Expected learning

The extension does not grant execution. Permissions and content format are what matter.

Lab 5 — IPC using a pipe

printf "ok\nerror\nwarning\nerror\n" | grep error
ps aux | grep ssh
journalctl -n 20 2>/dev/null | grep -i error || true
Expected learning

The output of one process becomes the input of another process.

Lab 6 — Named pipe / FIFO

mkdir ipc-lab
cd ipc-lab
mkfifo trainee_pipe

# Terminal 1:
cat trainee_pipe

# Terminal 2:
echo "hello from another process" > trainee_pipe

# Cleanup:
rm trainee_pipe
cd ..
Expected learning

A named pipe appears as a filesystem entry, but it behaves like a communication channel.

Lab 7 — Everything is file-like

ls -l /dev/null
printf "discard this" > /dev/null
ls -l /proc/$$
cat /proc/$$/cmdline | tr '\0' ' '; echo
ls -l /proc/$$/fd
Expected learning

/dev/null is a device file. /proc/$$ exposes information about the current shell process. fd shows open file descriptors.

8. Quick command reference

ObjectiveCommandExplanation
See current userwhoamiPrints the effective user name.
See UID/GIDidShows user ID, primary group, and supplementary groups.
See users logged inwho, wShows sessions and activity.
See processesps aux, topLists running work on the system.
Send a signalkill -TERM PIDRequests a process to terminate cleanly.
Inspect file typefile filenameReads content clues rather than only the name extension.
Show permissionsls -lDisplays type, permissions, owner, group, size, and timestamp.
Use IPC pipecmd1 | cmd2Sends stdout of one process to stdin of another.
See process pseudo-filesls /proc/$$Shows kernel information about the current shell.

9. Assessment quiz

Use this at the end of the session or as a revision check.

1. Which layer controls direct access to CPU, memory, disks, and devices?
2. In Linux, are Report.txt and report.txt always the same file?
3. What does a pipe do?
4. Does .sh alone make a file executable?
5. What is a process?

10. Trainer notes and teaching sequence

Recommended 60–90 minute flow

  1. Show the original architecture image and ask trainees to identify the center and outer layers.
  2. Explain hardware → kernel → system call → libraries/shell → apps.
  3. Run the multiuser and process commands.
  4. Demonstrate case sensitivity live.
  5. Run pipe and FIFO IPC labs.
  6. Show filename extension examples.
  7. Close with /proc, /dev/null, and quiz.

Common correction points

  • Linux is not “only command line”; it has GUI layers too, but the CLI makes architecture visible.
  • “Everything is a file” is an abstraction, not a claim that everything is a plain text file.
  • Extensions help people and applications, but permissions and content matter more to Linux.
  • Multiuser does not mean everyone has admin rights. Root privilege is exceptional.
  • IPC is everywhere: pipes, terminals, web services, databases, logging, service managers.