Navigating the filesystem

The Linux filesystem directory structure follows the Filesystem Hierarchy Standard (FHS), where every directory has a specific purpose.

Common directories

You can also run man hier to get a detailed description of the filesystem:

DirectoryDescription
/Beginning of the fs
/etcSystem-wide application configuration
/homeUser home directories
/rootHome directory for root
/mediaRemovable media, i.e. flash drives
/mntVolumes that will be mounted for a while
/optAdditional software packages
/binEssential user libraries such as cp, ls, etc…
/procVirtual filesystem for OS-level components such as running processes
/usr/binCommon user commands that are not needed to boot or repair the system
/usr/libObject libraries
/var/logLog files

Distro info

# --- Get distro info --- #
cat /etc/os-release 
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

# --- Get shorter distro info --- #
lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04.1 LTS
Release:	24.04
Codename:	noble

Viewing log files

/var/log/syslog - Contains information about processes happening in the background as your server runs, including warnings and errors.

  • If you have an error, look in syslog and then google for a resolution
head -n 100 /var/log/syslog             # view first 100 lines
head -100 /var/log/syslog

tail -n 100 /var/log/syslog             # view last 100 lines
tail -100 /var/log/syslog

tail -f /var/log/syslog                 # watch syslog in real time