Study material generated with AI (Claude) from the slides of ISO lecture 02, to be reviewed by the lecturers. It may contain mistakes; for the exam, the reference is the lecture and its slides. Found a mistake? Open an issue on the course repository.
About this material
How it was made
Text, figures and the demo terminal were generated with Claude (Anthropic) from the slides of lecture 02 – Files Management, following the structure of the interactive DEEA modules.
What was checked
The demo terminal was tested against the examples of the slides; its error messages follow GNU coreutils. The v86 Linux runs BusyBox, so a few messages differ.
Mistakes
If you find one, open an issue with the page and the sentence. Version: November 2026.
Sources and contributors
Slides: USO Team, Copyright (C) 2026 Wyliodrin & Politehnica Bucharest, CC-BY-SA 4.0. Bibliography: the sources listed in the slides of the lecture. Emulator: v86.
Every command in this lecture takes a path. A path only makes sense once you know the shape of the tree it walks: on Linux there is exactly one tree, and every disk, USB stick and even the running processes hang somewhere below /.
Windows
one tree per drive letter: C:\, D:\, E:\ ...
each partition is an independent file system
separator \ (backslash), names are case-insensitive: Readme.txt and README.TXT are the same file
C:\
├── Windows
│ └── System32
├── Program Files
│ ├── App1
│ └── App2
├── Users
│ ├── Alice
│ ├── Bob
│ └── Public
└── Temp
Linux (POSIX)
one single root/, no drive letters
other disks are mounted in a directory of the same tree (/media/alice/USB_STICK)
separator /, names are case-sensitive: Movies and movies are two different directories
/
├── bin
├── etc
├── home
│ ├── alice
│ └── bob├── media│ └── usb
├── tmp
└── usr
the USB stick is just another directory: /media/usb
Check yourself
Alice plugs in a USB stick on Linux. Where do its files show up?
The Linux layout
What every directory is for
Each directory directly below / has a job. You do not need to memorize them, but you should recognize them when a path starts with one.
All the directories in one table
Directory
What lives there
Windows equivalent
/
the top of the tree, the start of every absolute path
C:\
/bin, /sbin
essential programs: ls, cp, mv (everyone), mount, fsck, reboot (the administrator). On modern distributions they point to /usr/bin and /usr/sbin
C:\Windows\System32
/boot
starting the system: the kernel vmlinuz-6.x, the initial RAM disk initrd.img-6.x, grub/grub.cfg
the EFI partition, C:\Windows\Boot
/dev
devices seen as files: /dev/sda (first disk), /dev/sda1 (its first partition), /dev/null (discards everything), /dev/tty (this terminal)
special names: \\.\PhysicalDrive0, COM1, NUL
/etc
system-wide configuration, usually text files: /etc/passwd, /etc/hostname, /etc/fstab
the Registry (HKEY_LOCAL_MACHINE)
/home
one directory per user: /home/alice. A user can usually write only in their own
C:\Users\Alice
/lib
shared libraries (libc.so.6) and kernel modules (/lib/modules/6.x/)
.dll files in System32, drivers in System32\drivers
data that grows while the system runs: /var/log/, /var/cache/, /var/lib/ (databases)
C:\ProgramData, Event Viewer
Common mistake
/root is the root directory
/ is the root of the file system. /root is only the home directory of the user called root, one directory below /.
Instead: say slash for / and slash root for /root.
Check yourself
You changed the name of the computer and want to check the setting. Which file do you open?
Check yourself
Which directory is not stored on the disk?
Where a file is
Absolute and relative paths
Why it matters
Every file argument of every command is a path. Mixing up absolute and relative paths is the most common reason a command answers No such file or directory while the file is right there.
A path tells the operating system where a file or a directory is. Every running program has exactly one current directory at a time, and a relative path starts from it.
Absolute: from the root
Starts with / on Linux, with a drive letter on Windows. It means the same thing from anywhere.
Windows: from C:\Users\Alice: Videos\the_odyssey.mkv
Like directions from where you stand: you already know the country and the city.
/└── home └── alice📍
├── Downloads ├── Movies
│ └── the_odyssey.mkv🎯
└── watchlist.txt
absolute: /home/alice/Movies/the_odyssey.mkv (from /) · relative from 📍: Movies/the_odyssey.mkv
Why relative paths exist
A program finds its own files with relative paths (./textures), wherever it is installed. A script that only uses absolute paths breaks as soon as it is copied to another directory or another user.
Check yourself
The current directory is /home/alice/Downloads. Which file does Movies/the_odyssey.mkv refer to?
.../~
Special path symbols
Meaning
Windows
Linux
Notes
current directory
.
.
the directory you are in
parent directory
..
..
one level up
separator
\
/
between the names of a path
root
drive + \ (C:\)
/
the top of the tree
home directory
%USERPROFILE%
~
expanded by bash to /home/alice
\ on Linux is not a separator
It *escapes* the next character: my\ file.txt is one name with a space in it. ..\Videos is a Windows path.
~ belongs to the shell
bash replaces ~ with your home directory before the command runs. In quotes ("~") it is a plain character.
Windows also accepts /
C:/Program Files/App works in most programs. The reverse is not true: Linux never accepts \ as a separator.
Where am I, where is my parent
. and ..
Why it matters
Most paths you type are relative and climb the tree with ... Reading them one part at a time, the way the kernel does, removes all the guessing.
Every directory has two hidden entries:
📍 . the directory itself
⬆️ .. its parent
🔁 .. can be chained, each one goes one level up: ../..
⚠️ /.. is still /: the root has no parent
$ls-a. .. .bashrc Downloads Movies watchlist.txt
ls -a shows them, together with the other names that start with .
we are in /home/alice/Movies; every .. climbs one more level
Check yourself
You are in /home/alice/Movies. Where does cd ../../.. take you?
From relative to absolute
Walking a path, step by step
Read the path from left to right. Each part is one move in the tree, starting from 📍 /home/alice/Movies. Under the path, the same walk on paper: glue the path to the current directory, then cancel the parts.
. and .. anywhere
Tricky paths
The rule does not change when . and .. are in the middle of the path: glue the path to the current directory, drop every ., and let every .. remove the directory just before it. Both paths below are also in the walker on the previous page.
From /home/alice/Movies, what is ../Movies/../Downloads/. as an absolute path?
Check yourself
From /home/alice/Movies, what is /../home/./bob?
man pwd
Reading a manual page
Why it matters
The manual installed on your computer describes exactly the version you run. Web pages and AI answers are often for another version, or simply wrong; the manual is the reference you check them against.
PWD(1) User Commands PWD(1)
NAME
pwd - print name of current/working directory
SYNOPSIS
pwd [OPTION]...
DESCRIPTION
Print the full filename of the current working
directory.
-L, --logical
use PWD from environment, even if it
contains symlinks
-P, --physical
avoid all symlinks
--help display this help and exit
EXIT STATUS
0 on success, any other value on an error
EXAMPLES
$ cd /home/alice/Movies && pwd
/home/alice/Movies
SEE ALSO
cd(1), ls(1)
man pwd, shortened
Part
What it tells you
PWD(1)
the name and the section of the page; section 1 is User Commands
NAME
what the command is, in one line
SYNOPSIS
how to call it: [ ] is optional, ... can repeat
DESCRIPTION
what it does and every option: -P short, --physical long, same meaning
EXIT STATUS
0 means success, anything else is an error
EXAMPLES
commands to try and what they print
SEE ALSO
related pages: cd(1) is the page of cd in section 1
Inside the viewer
man shows the page in less, a viewer driven by single keys. You do not know the option yet, so search for what you want to do: /reverse finds -r, --reverse. For a quick summary instead of the whole page, most commands print one with --help: ls --help.
Check yourself
A SYNOPSIS says ls [OPTION]... [FILE].... Which call is not allowed by it?
Commands take paths, not just names
Files are paths
When a command expects a file or a directory, it accepts any path to it. All four commands below, run from /home/alice/Movies, print the same file.
$cat ../watchlist.txt # relative, glued to /home/alice/MoviesProject Hail Mary$cat /home/alice/watchlist.txt # absolute, from /Project Hail Mary$cat ~/watchlist.txt # ~ is /home/aliceProject Hail Mary$cat ../../alice/Downloads/../watchlist.txt # a detourProject Hail Mary
cat prints the content of a file.
/
└── home └── alice
├── Downloads ├── Movies📍
│ └── the_odyssey.mkv └── watchlist.txt🎯
one file, many paths to it
Paths in the SYNOPSIS
In a manual, FILE, DIR, SOURCE and DEST almost always mean a path. Relative and absolute paths can be mixed in the same command.
cp ../watchlist.txt /tmp/ copies a different file (or fails) when you run it from another directory. Check with pwd, or look at the prompt, before you run a command with relative paths.
Where am I, go there
pwd and cd
Why it matters
The current directory decides what every relative path means. pwd tells you where you are, cd moves you; together they replace the address bar of a graphical file manager.
pwd: print working directory
Prints the absolute path of the current directory.
$pwd/home/alice/Movies
The prompt alice@iso:~/Movies$ already shows it, with ~ for the home directory.
cd: change directory
cd [DIR] # no DIR: go to the home directory
$cd /home/alice/Downloads # absolute$cd ../Movies # relative$cd- # the previous directory/home/alice/Downloads$cd-/home/alice/Movies$cd ~ # home$cd # home, too
/└── home └── alice ├── Movies📍
└── Downloads
pwd prints the path from / to 📍
Common mistake
cd - means back
cd - switches between the last two directories, like the button that toggles between two TV channels. Pressed again, it returns where you were, not one step further back.
Instead:cd .. to go up one level, cd - to toggle.
List a directory
ls
ls [OPTION]... [FILE]...
$lsDownloads Movies watchlist.txt$lswatchlist.txt Movieswatchlist.txtMovies:the_odyssey.mkv$ls-a. .. .bashrc Downloads Movies watchlist.txt$ls-l -h~drwxr-xr-x 2 alice alice 4.0K Sep 20 18:02 Downloadsdrwxr-xr-x 2 alice alice 4.0K Sep 26 21:15 Movies-rw-r--r-- 1 alice alice 21K Sep 28 21:40 watchlist.txt
$find MoviesMoviesMovies/the_odyssey.mkv$find.-name "*.mkv"./Movies/the_odyssey.mkv$find Movies Downloads -type fMovies/the_odyssey.mkvDownloads/supergirl.mp4$find ~ -type f -name"*.txt"/home/alice/watchlist.txt
without a filter: the directory and everything inside it
-name by name, * means any characters
-type f only files, -type d only directories
several filters: a result must match all of them
the results start with the path you gave: start from ~ (an absolute path) and you get absolute paths
Common mistake
find . -name *.mkv
Without quotes, if the current directory has .mkv files, bash replaces *.mkv with their names before find runs. With one match, find only searches for that exact name; with two, it fails with paths must precede expression.
Instead: always quote the pattern: find . -name "*.mkv".
Copy files and directories
cp
Why it matters
Copying, moving, creating and deleting is most of what you do with files. The commands are short, they do not ask for confirmation and rm has no trash: knowing exactly what each one does is the only protection.
cp [OPTION]... SOURCEDEST # DEST: a new name or a directory
cp [OPTION]... SOURCE... DIRECTORY # several sources: the last parameter is a directory
$cpwatchlist.txt/home/alice/backup/$cpMovies/the_odyssey.mkv Movies/toy_story_5.mkvbackup/$cp Movies backup/cp: -r not specified; omitting directory 'Movies'$cp-rMovies//home/alice/backup/
after the four commands: the sources are gone, Movies_2026 keeps the content
Check yourself
~/Movies exists. What does mv watchlist.txt Movies do?
Create directories and files
mkdir, touch and nano
mkdir [OPTION]... DIRECTORY...
$mkdir Movies$mkdir Movies/2026/animationmkdir: cannot create directory 'Movies/2026/animation': No such file or directory$mkdir-p Movies/2026/animation
-p also creates the missing parent directories and does not complain if they exist.
In the shell there is no trash and no undo: rm deletes permanently. rm -r on the wrong relative path (rm -r ../Movies from the wrong directory) removes a whole tree without a question.
Instead: run pwd and ls on the same path first, and use rmdir for directories you expect to be empty: it refuses to delete anything else.
The same commands, with a few keys
Terminal file managers
A terminal file manager shows the tree and runs the file commands for you. Useful when you work on a server over SSH, where there is no graphical interface.
Reading about commands is not the same as typing them. Each mission below is checked automatically against the file system of the sandbox; the tree on the right shows what every command changed.
This is a demo terminal
Not a real Linux: a small shell written in JavaScript, with an in-memory file system and the commands of this lecture (pwd cd ls tree find cp mv mkdir touch nano rm rmdir cat echo man). Error messages are the ones GNU coreutils prints. Pipes, permissions and the other commands come in later lectures.
v86
A real Linux
The same commands on a real kernel: the v86 emulator runs an x86 PC inside the browser and boots a small Linux (Buildroot, with BusyBox instead of GNU coreutils, so a few messages differ). Log in as root, then press Create the lecture files to get the directories of the lecture.
Your own machine
For the labs you need a full distribution (the virtual machine from lecture 01). The emulator is for trying a command when you have only a browser.
Quick recap
The ideas, in short
One idea per card; the title is the idea, the text says why it matters in practice. Recap shows all the cards, Flashcard one at a time.
01 · One tree
Linux has one tree, rooted at /
click / Space
01 · One tree
Linux has one tree, rooted at /
There are no drive letters. A USB stick or a second disk appears as a directory of the same tree, usually below /media.