Linux is not magic. It is a big school: rooms, drawers, teachers, guards, notebooks, and tiny workers. This page turns every TP file in this workspace into one simple revision website.
pwd, ls, cd, man pages, FHS.
GRUB, kernel, initrd, systemd, targets.
dpkg, apt, yum, zypper.
stdin, stdout, stderr, redirection, tee, xargs.
chmod, owners, groups, sticky, setuid, setgid.
ps, top, signals, jobs, screen, tmux.
Partitions, filesystems, swap, mount, XFS, LVM.
Wrong assumptions that make correct-looking commands fail.
Before touching files, you must know the room you are standing in. If you skip this, every later command becomes guesswork.
The command line is you walking inside the house. pwd says "you are here". ls opens your eyes. cd moves your feet. man is the instruction book.
ls, so I know Linux" is false. ls only shows objects. Linux skill means knowing paths, permissions, owners, devices, processes, and services.
man is split into sections. User commands live in section 1, system calls in section 2, C library functions in section 3, file formats in section 5, admin tools in section 8.
/ is the front door. /home is users' bedrooms. /etc is the rule book. /bin and /usr/bin hold tools. /var is where changing things like logs live.
/etc. If it changes all the time, think /var. If it is personal, think /home.
ls patterns| Question | Command | Simple idea |
|---|---|---|
| Long details | ls -l | Show owner, group, size, date, permissions. |
| Hidden files too | ls -la | Show the secret files starting with a dot. |
| Newest first | ls -lt | Sort by time, newest on top. |
| Oldest first | ls -ltr | Reverse the time order. |
| Six-character names | ls ?????? | Each ? is exactly one character. |
| Starts with D or d | ls [Dd]* | Use brackets for choices. |
A powered-off machine is asleep. Booting is the morning routine that brings it to life.
systemd starts services and targets.| Need | Command | ELI5 meaning |
|---|---|---|
| See processes | ps -ef, pstree -p | Who is awake, and who woke them up? |
| Read kernel messages | dmesg, journalctl -k | Read the machine's morning diary. |
| Manage service | systemctl status nginx | Ask if the web-server worker is okay. |
| Change target | systemctl isolate multi-user.target | Switch to another system mood. |
| Shutdown | shutdown -h now | Tell everyone: stop now. |
| Reboot at midnight | shutdown -r 00:00 "message" | Schedule a restart and warn users. |
/boot/grub/grub.cfg as your normal plan. The cleaner source is /etc/default/grub, then regenerate with update-grub or grub-mkconfig.
Linux has real files and fake-looking files that are actually windows into the kernel. Do not confuse them.
uname tells you about the kernel. lscpu tells you about the CPU. /proc and /sys are not normal folders; they are live reports from the kernel.
A module is a plug-in for the kernel. Load it when needed; remove it when not needed. Example: ip_tables helps firewall rules.
/dev/sda is a disk-like block device. /dev/tty is a character device. udev creates device nodes dynamically when hardware appears.
| Tool | Use | Simple image |
|---|---|---|
lspci -v | Show PCI devices | Look at big internal cards. |
lspci -k | Show kernel drivers | Which teacher handles each card? |
lsusb -v | Show USB devices | Look at things plugged into USB. |
lsusb -t | Show USB tree | Draw the USB family tree. |
Programs often borrow common code from .so files. That saves memory, like many children using one big box of crayons instead of each child buying a box.
ldd /sbin/init lists libraries required by the executable.
ldconfig -p reads the linker cache, built from config such as /etc/ld.so.conf.
LD_LIBRARY_PATH
It is temporary and can make programs load the wrong library. Use it for tests, not as your lazy permanent fix.
A package is a prepared box of software. The package manager knows where files go and what extra boxes are needed.
dpkgIt installs a local .deb file, but it is not smart about fetching missing dependencies.
sudo dpkg -i discord.deb
aptIt talks to repositories and solves dependency chains. Use this when possible.
sudo apt install ./discord.deb
dpkg fails because dependencies are missing, repeating the same command is not strategy. Use apt to resolve the missing boxes.
| Task | Command |
|---|---|
| List installed packages | dpkg -l |
| Show files inside a package file | dpkg -c discord.deb |
| List files installed by a package | dpkg -L discord |
| Remove, keep config | sudo apt remove discord |
| Remove with config | sudo apt purge discord |
| Clean unused dependencies | sudo apt autoremove |
| Search packages | apt-cache search htop |
| Show dependencies | apt-cache depends htop |
Ubuntu uses Debian-style tools. Red Hat uses RPM/YUM. openSUSE uses Zypper. Same goal, different language.
| Family | Low-level | Smart manager | Example |
|---|---|---|---|
| Debian/Ubuntu | dpkg | apt, aptitude | apt install htop |
| Red Hat/Fedora | rpm | yum | yum install htop |
| openSUSE | RPM base | zypper | zypper install htop |
The shell is not just typing commands. It is variables, children shells, input/output streams, and search tools.
A command has three straws: stdin 0 drinks input, stdout 1 spits normal output, and stderr 2 spits errors.
MY_VAR=value stays in the current shell. export MY_VAR=value gives the variable to child shells too.
find searches live. locate searches a database. which checks PATH. type tells if something is builtin, alias, function, or binary.
Each filter does one small job. The power comes from combining them.
| Tool | Job | Example |
|---|---|---|
cat | Print or join files | cat a b > c |
less | Read big files page by page | less /etc/passwd |
head / tail | Start or end of file | tail -n 20 /etc/passwd |
nl | Number lines | nl -b a testfile1 |
wc | Count words, lines, bytes | wc -l /etc/passwd |
od | Show bytes as characters/hex | od -c /etc/passwd |
sort | Sort lines | sort -t, -k1,1n testfile |
tr | Translate/delete chars | tr ',' ';' |
cut | Take columns | cut -d',' -f4 testfile |
paste | Put files side by side | paste -d',' a b |
uniq | Collapse repeated neighbors | sort f | uniq -c |
sed | Edit stream text | sed 's/Employee/Lawyer/g' |
uniq only removes neighboring duplicates. If duplicates are scattered, sort first: sort file | uniq.
A hash is a fingerprint. Change one letter in the file, and the fingerprint changes.
mkdir creates folders. cp copies. mv moves or renames. rm deletes. There is no recycle bin in a normal shell.
This TP connects four survival skills: packing files, finding text, editing safely, and controlling access.
tar makes a suitcase. gzip, bzip2, and xz squeeze the suitcase smaller.
| Need | Command |
|---|---|
| Create tar | tar -cvf file.tar testfile1 testfile2 |
| List tar | tar -tvf file.tar |
| Extract tar | tar -xvf file.tar |
| gzip tar | tar -czvf file.tar.gz files... |
| bzip2 tar | tar -cvjf file.tar.bz2 files... |
| xz tar | tar -cvJf file.tar.xz files... |
| cpio create | find . | cpio -o > content.cpio |
| cpio extract | cpio -idvu < content.cpio |
Regex is a fishing net for text. Different shapes catch different fish.
Vim has modes. Normal mode is for commands. Insert mode is for writing text. If you mix them up, Vim feels hostile because you are speaking the wrong language.
A file has an owner, a group, and others. Each can read r, write w, or execute/search x.
| Need | Command | Meaning |
|---|---|---|
| Create user | sudo useradd -m -d /home/newuser newuser | Create account and home. |
| Change owner | sudo chown newuser filerights | Give the file to a user. |
| Change group | sudo chgrp newuser filerights | Put the file in a group. |
| Read/write for all | chmod 666 filerights | Everyone can read and write. |
| Sticky bit | chmod o+t testdir | Only owner/root deletes inside. |
| Setuid | chmod u+s setuidfile | Run with file owner's privileges. |
| Setgid | chmod g+s testdir | New files inherit directory group. |
| Default mask | umask 0026 | Subtract permissions from new files. |
S or T means the special bit is set but execute/search permission is missing. That is usually a warning sign, not a feature.
A process is a running program. Signals are messages you send to workers: stop, continue, terminate, or die now.
| Need | Command | Kid version |
|---|---|---|
| All processes | ps -ef | Class photo of all workers. |
| Live dashboard | top | Watch workers in real time. |
| Memory | free -h | How much desk space is free? |
| Find bash PIDs | pgrep -l bash | Find workers by name. |
| List signals | kill -l | List all messages you can send. |
| Gentle stop | kill -15 PID | Please clean up and stop. |
| Forced stop | kill -9 PID | Stop now, no goodbye. |
| Pause/resume | kill -19 PID / kill -18 PID | Freeze / continue. |
| By exact name | pkill -x -15 nginx | Signal all matching workers. |
Ctrl+Z pauses a foreground job. fg brings it back. bg lets it continue behind you. screen and tmux keep terminal sessions alive.
nice starts a command with a priority. renice changes priority after the process is already running.
Two names point to the same inode. Change one, the other changes because they are the same data.
ln filelink1 filelink2
A shortcut containing a path. If the target disappears, the link becomes broken.
ln -s filelink3 filelink4
A virtual machine is a whole pretend computer. A container is a small separated room sharing the host kernel. LXD containers are lighter, but they are still Linux-on-Linux isolation, not full hardware emulation.
A disk is raw space. A partition cuts it. A filesystem organizes it. A mount attaches it to the house.
lsblk, cat /proc/partitions, fdisk -l.fdisk, gdisk, or parted.mkfs.ext4 /dev/sdb1, mkfs.xfs /dev/sdd1.mount /dev/sdc1 ~/xfs, then use /etc/fstab for boot-time mounting.| Need | Command | Meaning |
|---|---|---|
| Block devices | lsblk, lsblk -f | Show disks, partitions, filesystems. |
| Mounted usage | df -h, df -i | Show space and inode usage. |
| UUIDs | blkid | Show stable device identifiers. |
| Check ext FS | fsck /dev/sdd1 | Repair unmounted ext filesystem. |
| Swap | mkswap, swapon, swapon --show | Use disk space as emergency memory. |
| Disk usage | du -hs /usr | Measure folder size. |
| Raw copy | dd if=testfile of=testfile.123 bs=4096 | Copy bytes carefully. |
| ext tuning | tune2fs -l /dev/sdaX | Read or change ext filesystem settings. |
ext2 old, no journal. ext3 adds journal. ext4 modern default. xfs strong for large data. btrfs snapshots/checksums. vfat removable Windows-friendly media.
XFS has its own repair and inspection tools. Use the right doctor for the right patient.
LVM lets you combine physical disks into flexible storage pools, then create logical volumes that can grow more easily.
| Layer | Command | Question answered |
|---|---|---|
| PV | pvs | Which physical disks are used? |
| VG | vgs | How big is the shared pool? |
| LV | lvs | Which virtual partitions exist? |
This is the part where I do not sugarcoat it. These mistakes lose points because the logic is wrong, not because the command spelling is ugly.
SIGTERM first. SIGKILL is the hammer when cleanup does not matter or cannot happen.tune2fs -j moves it toward ext3 behavior.dpkg is lower-level; apt resolves dependency packages.PATH.pwdShow current directory.
ls -laList files with details, including hidden ones.
manRead command documentation.
systemctlManage services and targets.
journalctl -kRead kernel logs from the journal.
apt installInstall packages with dependency solving.
sedEdit text streams or files.
grep -ESearch text with extended regex.
ps -efList running processes.
kill -15 PIDAsk a process to terminate cleanly.
lsblk -fShow disks, partitions, and filesystems.
mountAttach a filesystem to the directory tree.
pvs / vgs / lvsInspect LVM layers.
ln / ln -sCreate hard or symbolic links.
tarCreate, list, and extract archives.
If you can explain these out loud without hiding behind memorized commands, you are actually ready.
| TP | Main lesson | Must-know commands |
|---|---|---|
| TP1 | Navigate, read docs, understand FHS. | pwd, man, ls, cd |
| TP2 | Boot chain and service manager. | systemctl, journalctl, shutdown |
| TP3 | Kernel modules, devices, libraries. | uname, lsmod, modinfo, lspci, ldd |
| TP4 | Install and remove packages. | dpkg, apt, apt-cache, yum, zypper |
| TP5 | Shell variables, finding files, streams. | env, set, find, locate, tee, xargs |
| TP6 | Text filters and file management. | head, tail, sort, tr, cut, sed, rm |
| TP7 | Archives, regex, Vim, permissions. | tar, gzip, grep, vim, chmod, chown |
| TP8 | Processes, jobs, links, containers. | ps, top, kill, jobs, ln, lxc |
| TP9 | Disks, filesystems, swap, LVM. | lsblk, fdisk, mkfs, mount, df, pvs |
This website is based on all workspace references: TP1 to TP9 subject PDFs, TP1 to TP5 answer PDFs, and TP6 to TP9 answer text files.