ubuntu, updated

Where is what? The folder layout

What lives in /etc, /var, /home, /opt and the other top-level folders, and where to look for configs, logs and data.

The top-level folders

Every Linux system follows roughly the same layout (the Filesystem Hierarchy Standard). Once you know it, you know where to look on any server.

FolderContainsYou go there for
/etcSystem-wide configuration (text files)Changing settings
/var/logLog filesTroubleshooting
/var/libProgram data: databases, Docker, package stateFinding app data
/home/USERUsers’ personal filesUser data
/rootHome folder of root
/srvData served by this server (websites, shares)Your own service data
/optThird-party software installed outside aptVendor apps
/usr/bin, /usr/sbinInstalled programs
/usr/localSoftware you compiled or installed by handYour own scripts (/usr/local/bin)
/tmpTemporary files, cleaned on reboot
/bootKernel and boot loaderRarely, careful
/dev, /proc, /sysDevices and live kernel info (virtual)See Everything is a file
/mnt, /mediaMount points for temporary / removable disksMounting
/runRuntime data (PIDs, sockets), gone on reboot

On current Ubuntu, /bin, /sbin and /lib are just links into /usr.

Configs you will touch most

File / folderControls
/etc/netplan/*.yamlNetwork (Netplan)
/etc/fstabDisks mounted at boot (Format and mount)
/etc/hosts, /etc/hostnameLocal name resolution, server name
/etc/ssh/sshd_config (+ sshd_config.d/)SSH server
/etc/sudoers.d/Who may use sudo (Who is sudo?)
/etc/passwd, /etc/groupUsers and groups (Users)
/etc/apt/sources.list.d/Package sources
/etc/systemd/system/Your own service units and overrides

The .d folders

Many programs read a main config plus every file in a matching .d folder, for example /etc/ssh/sshd_config.d/. Put your changes in your own file there instead of editing the main file. Package updates then won’t overwrite your settings, and you can see at a glance what you changed.

Logs

Logs are in the systemd journal (journalctl) and in /var/log. Which log holds what: Where are the logs?

§ home
~/knubertus/home/
1,1 Top