diff --git a/content/en/2.general/5.linux/1.cli-basics.md b/content/en/2.general/5.linux/1.cli-basics.md index 9978154..95c2e51 100644 --- a/content/en/2.general/5.linux/1.cli-basics.md +++ b/content/en/2.general/5.linux/1.cli-basics.md @@ -73,7 +73,7 @@ Once the pattern clicks, commands can be plugged into each other: Most command names are abbreviations of an English phrase. Once you know what they stand for, they stop looking like keyboard noise. -### pwd, print working directory +### `pwd`, print working directory Tells you where you are. It changes nothing, it just answers the question. @@ -85,7 +85,7 @@ pwd /home/username/docker ``` -### ls, list +### `ls`, list Lists what's in the current folder. On its own it prints bare names, so it's almost always used with options: `-l` for the long format with sizes, dates and permissions, `-a` to also show hidden files (the ones starting with a dot), `-h` for sizes in K/M/G instead of raw bytes. @@ -104,7 +104,7 @@ drwxr-xr-x 3 username username 4.0K Sep 2 18:44 immich The first column is the permissions, `d` at the very start meaning it's a folder. Then the owner, the size, the date of the last change, and the name. -### cd, change directory +### `cd`, change directory Moves you around. With a path it goes there, with `..` it goes up one level, and with nothing at all it takes you back home. @@ -117,7 +117,7 @@ username@serveex:~$ Notice the prompt following you around: it always shows where you currently stand, so you rarely need `pwd` in practice. -### mkdir, make directory +### `mkdir`, make directory Creates a folder. Several at once if you list them, and `-p` creates the whole chain of parents in one shot, which is the version you'll actually use. @@ -132,7 +132,7 @@ mkdir -p docker/immich/config Nothing. That's not a bug, it's the rule: most commands say nothing when they succeed and only speak up when something goes wrong. Silence is good news, and `ls` confirms the folder is there. -### cp and mv, copy and move +### `cp` and `mv`, copy and move `cp` copies, `mv` moves. Same shape both times: first the source, then the destination. Copying a folder needs `-r`, for *recursive*, since a folder means everything inside it too. `mv` doubles as the rename command, because renaming a file is just moving it to a new name. @@ -149,7 +149,7 @@ compose.yaml compose.yaml.bak config config-backup new-name.txt Three silent commands, and `ls` showing the result: the copy sits next to the original, the folder was duplicated, and `old-name.txt` is gone because moving it to another name is exactly what renaming means. -### rm, remove +### `rm`, remove Deletes. There is no recycle bin, no undo, no confirmation dialog. `-r` deletes a folder and its contents, `-f` forces without asking. @@ -157,7 +157,7 @@ Deletes. There is no recycle bin, no undo, no confirmation dialog. `-r` deletes `rm -rf` is the command that wipes homelabs. It doesn't check, doesn't warn, and doesn't stop. Read the path twice before pressing :kbd{value="Enter"}, especially when the line starts with `sudo` and contains a `/` or a `*`. You can also prevent this by wrapping `sudo` in a small Bash function that asks **"are you sure?"** before it lets an `rm` through, covered in **rm confirmation guard**. :: -### cat and nano, read and edit +### `cat` and `nano`, read and edit `cat` (short for *concatenate*) dumps a whole file to the screen, perfect for a short config. For anything longer, `less` scrolls through it (named as a joke on `more`, the older pager it replaced), and you quit it with :kbd{value="Q"}. @@ -173,7 +173,7 @@ PGID=1000 TZ=Europe/Paris ``` -### grep, search inside files +### `grep`, search inside files `grep` stands for *global regular expression print*, which is a mouthful for "find me this text". You give it what to look for and where, and it prints every matching line. `-r` searches a whole folder, `-i` ignores upper and lower case, `-n` shows line numbers. @@ -188,7 +188,7 @@ grep -rin "password" /home/username/docker Each line is the file, then the line number inside it, then the matching line itself. Very handy for the day you can't remember which stack holds a setting. -### sudo, run as administrator +### `sudo`, run as administrator *Substitute user do*. A normal user can't touch the system's files, which is exactly what protects you from wrecking the machine by accident. Prefixing a command with `sudo` runs that single command with administrator rights, and asks for your password the first time. diff --git a/content/en/2.general/5.linux/3.handy-tools.md b/content/en/2.general/5.linux/3.handy-tools.md index 72a53bb..f0cce95 100644 --- a/content/en/2.general/5.linux/3.handy-tools.md +++ b/content/en/2.general/5.linux/3.handy-tools.md @@ -34,7 +34,7 @@ sudo apt update sudo apt install btop duf ncdu tealdeer ufw ``` -## btop, watching what the machine is doing +## `btop`, watching what the machine is doing The modern replacement for `top` and `htop`: CPU, RAM, disks, network and processes on one screen, with graphs, colors and a working mouse. This is what you open when something feels slow. @@ -58,7 +58,7 @@ Click a process to select it, :kbd{value="Esc"} opens the menu, :kbd{value="Q"} #### Done ! :: -## duf, disk space that reads like a table +## `duf`, disk space that reads like a table `df -h` prints every loop device Docker ever created and leaves you squinting at the columns. `duf` shows the same information grouped, aligned and colored, with a usage bar per filesystem. @@ -82,7 +82,7 @@ Local disks, network shares and system mounts are grouped separately. Add `--onl #### Done ! :: -## ncdu, finding what ate the disk +## `ncdu`, finding what ate the disk When `duf` tells you the disk is full, `ncdu` tells you why. It walks a folder, sorts everything by real size, and lets you drill down with the arrow keys instead of running `du -sh *` twenty times. @@ -108,7 +108,7 @@ Arrows to move, :kbd{value="Enter"} to open a folder, :kbd{value="D"} to delete #### Done ! :: -## tldr, the manual without the 400 lines +## `tldr`, the manual without the 400 lines `man tar` is exhaustive and unreadable. `tldr tar` gives you the five commands people actually type, with a one-line explanation each. It's community-maintained examples rather than a substitute for the real manual, and on Debian the client is packaged as `tealdeer`. @@ -136,7 +136,7 @@ tldr rsync #### Done ! :: -## lazydocker, managing containers from the terminal +## `lazydocker`, managing containers from the terminal The one exception: it isn't packaged by Debian. It's a full text interface for Docker, containers, images, volumes and logs in one screen, with keys to restart, stop or follow the logs of anything. Handy when you're already in SSH and don't feel like opening Dockge. @@ -200,7 +200,7 @@ Being outside `apt` also means it won't be updated by `apt full-upgrade`. Repeat #### Done ! :: -## ufw, a firewall you can actually read +## `ufw`, a firewall you can actually read Debian's firewall (`iptables`/`nftables` under the hood) is powerful and unreadable directly. `ufw`, *uncomplicated firewall*, is a thin layer on top that turns it into short, plain-English rules, block everything by default and open only what you actually expose.