mrgoblin logo

mrgoblin

mrgoblin blog


Linux giggles #1: Paths

Thu Sep 17 13:16:03 2026 UTC

Hi! You are reading Linux giggles. Let's talk about paths.

Path is a string specifying how to find some file or directory in the system. Paths can be relative and absolute. Absolute path is a path which starts with "/", relative paths are ones not starting with it, they are counting each time from your current working directory.

For example, if your user is jack and you are in your home and there is a recipes directory in it, your current working dir (absolute path) is /home/jack, recipes catalog's absolute path is /home/jack/recipes, relative - recipes.

If you go in recipes, your new working directory is now /home/jack/recipes. But you realize that new Carbonara's recept from your favorite site is in Downloads/ which is in your home! Can you get it by a relative path?

Of course you can! In Unix-like systems (which Linux is) there are always "." and ".." in every directory. The "." means the directory itself, ".." means its parent catalog. For recipes, parent is your home. So what is the relative path to Carbonara recipe (let's call it carbonara.txt) from recipes? If you answered ../Downloads/carbonara.txt, you are absolutely right!

Questions:

  1. What is a relative path to /home/bob from /home/alice/programs?
  2. You are in /usr/local/etc/nginx. What is an absolute path for ../postfix/main.cf file?

Please leave a comment. See you!


Linux giggles #0: Introduction

Tue Sep 15 17:41:33 2026 UTC

Hi! It is the pilot episode of "Linux giggles" - series where I post about Linux for beginners. Today I will tell you about terminal and shell.

Terminals were physical devices with a keyboard for input and screen or printer for output (ones with printer are called teletypes). They were the only way to interact with a computer.

But now most users have a keyboard and monitor or laptop screen, so physical terminals are dead. Instead of those we have terminal emulators such as xterm, Konsole, st, Alacritty and others. Which one do you use?

A program called shell shows you a prompt, takes your input (the command line), splits it into arguments and runs the command. On your system it mostly will be sh, bash or zsh.

Basically, when you start a terminal emulator, it runs the shell. You will see the prompt which probably will show your username, hostname and current working directory:

rex@debian:~$

The "~" (tilde) represents your home directory. The real path to your home is usually /home/your_username. It can also be useful to know that you can access to some user's home with ~the_username.

Please leave a comment. See you!


Forgejo! (no, cgit)

Sun Sep 13 16:23:21 2026 UTC

UPD: A Forgejo istance is not accessible on git.mrgoblin.net, now cgit is there. Please note it is not a "web application" so it won't send you a JavaScript program that your browser will immediately execute. Site where you are reading it also doesn't use JavaScript; but please be careful in the web because almost all other sites will send you a computer program that will do what they want, not what you want.


Hello, world!

Thu Sep 3 15:07:00 2026 UTC

Site is up. Of course it's quite raw (well, very raw) yet, but as is. Stay tuned.


RSS feed