[Linux][System] Learning Linux File Structure

/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

--

--

--

HI I’m N2I. Now a SWE in Taiwan. Check out more about me in https://nzi2020.blogspot.com/ or contact via email: nayzi9999@gmail.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Explaining LSH-Minhash-Simhash

The best Programming languages to start with.

MongoDB: Improve Performance With Indexes and Covered Queries

AWS Community Day, Pune (2020 Edition)

How to create an advanced local Kubernetes cluster

Do you want to build a high-performance mobile application?

Rails Project

Living in the #ifdef Hell

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
N2I

N2I

HI I’m N2I. Now a SWE in Taiwan. Check out more about me in https://nzi2020.blogspot.com/ or contact via email: nayzi9999@gmail.com

More from Medium

Essential Linux Commands for beginners

Getting Familiar with the Basics of Linux

Bash Scripting for auto-commit and push GIT

Linux Configure Xauthority