Ruka
2 min readMar 26, 2022

[Linux][System] Learning Linux File Structure

Check out the reference yt video for more infos
2022.03.26

/bin

  • System Binaries (programs, applications)
  • Must be accessable in single user mode (check out linux runlevels or wiki)
  • UNIX system resource
  • installing a user program is not placed in this folder
/bin/cat
/bin/ls
/bin/bash
/bin/chmod

/sbin

  • System Binaries for system administrator (programs, applications)
  • Must be accessable in single user mode (check out linux runlevels or wiki)
  • UNIX system resource
  • installing a user program is not placed in this folder

/boot

  • Contains Boot loaders
  • Everything OS needs when boot

/dev

  • Devices
  • Architecture following UNIX (Everything is a file)
  • Where application and drivers will access for devices(webcam, keyboard etc)
# Example
# Hardware disk
/dev/sda
# Disk partition
/dev/sda1

/etc

  • Etcetera
  • System-wide Configurations
  • System-wide application settings
/etc/apt
/etc/apt/sources.list

/lib, /lin32, /lib64

  • library
  • files that applications can use
  • used by bin | sbin

/media

  • mount drives
  • USB disck, external hard drive, second hard drive (B Drive, D Drive)
  • manage by OS
/media/<username>/<device-name>

/mnt

  • mount drives
  • manage manually

/opt

  • Optional folder
  • Software from vendors, example: Virtual box guest addition
  • Also a place to install sofware you create yourself
/opt/<software-folder>/<software-stuffs>

/proc

  • Processes
  • Pseudo file of Informations and resources for every process
  • Like /dev, but not acually file but some information generate by kernal
  • Handy information for System status, provide by kernal
/proc/<PID>/<file-for-that-process>
/proc/cpuinfo
/proc/uptime

/root

  • Home folder for root users
  • need root permission to access

/run

  • tempfs file system
  • file system which runs in RAM, will disappear when reboot or shutdown

/snap

  • Snap package were stored here (check out snap packages)
  • mainlly used by Ubuntu
/snap/bin/
/snap/gnome-3-26-1604/

/srv

  • service data
  • FTP server or web server will store files here for external user to access
  • Can mount this folder from another hard drive

/sys

  • System folder
  • Interact with kernel
  • Similar to /run (not physically written to disk), created every time the system boots up.
/sys/dev/
/sys/kernel/
/sys/devices/
/sys/bus/

/tmp

  • temporary directory
  • application could store some auto save file here to prevend application crashes

/usr

  • Universal System Resource
  • Non-essential applications for basic system operation
/usr/bin/
/usr/sbin/
/usr/lib/
/usr/local/bin/
/usr/local/sbin/
/usr/local/lib/
/usr/share

/var

  • Variable directory
  • Contains files and directories that are expected to grow in size
/var/crash/
/var/log/

/home

  • Home folder for eash user
  • Can mount this folder from different drive, so user can reinstall system and preserve your file
  • Hidden directory here to store your application setting
/home/<username>/Desktop
/home/<username>/.cache
/home/<username>/Documents

/cdrom

  • legacy mounting point for CD-Rom

Other Information

Q1: How to access to / folder

  • Open terminal and use command cd /
  • Open Files GUI, select +Other Location and select your system drive

Reference

Ruka
Ruka

Written by Ruka

HI I’m Ruka. Now a SWE in Taiwan. Contact via email: nayzi9999@gmail.com

No responses yet