HvdW wrote: ↑Monday 22 January 2024 12:12
What is the
. (dot) for?
3 importants characteristics of unices file trees are:
-Being single rooted, thus no drive letters (firsts for floppies no more use) as windows (a:, b:, c: etc) used natively (if using cygwin, posix compatibility layer for windows that brings many Linux/Unix tools/shells etc, it brings some compatibility making a single root named /cygdrive, so c: becomes /cygdrive/c for instance).
-Current directory is .
-Parent directory is .. (exception for root directory or a mount point, where .. points to itself so same as .), that keeps the needed tree link, here are first 2 inodes of my system root:
=> same inode = 2
For my current account home directory:
Code: Select all
ls -ai ~ | head -n 2
16384001 .
2 ..
Different inodes nb for . and .. here, that's correct as it's not a root. But you can see parent .. is also inode 2: Same as / but why? Let's see /home under /home/MY_USERNAME:
Home is not my system root, but a mount point (so same situation, that's another FS so same inode allocation starting from it's own root) as I always use separate partition for /home when installing a Linux/Unix machine (better if full OS re-installation someday needed: I can completely screw / system partition and keep /home intact, not re-format done by installer).
File that declares mounts to be done at boot confirms (that's now UUID instead of /dev/sdX to identify partitions but there is still installer comments):
Code: Select all
grep /dev/sd /etc/fstab
# / was on /dev/sda2 during installation
# /boot/efi was on /dev/sda1 during installation
# /home was on /dev/sda4 during installation
=> / is on second drive partition (1st is the mandatory one since UEFI replaced legacy BIOSes, as I show this from a Linux PC and not my PI) ; /home on 4th partition thus not directly inside / as it would be if followed Debian installer defaults.