Skip to content

Latest commit

 

History

History
28 lines (28 loc) · 3.84 KB

05.interesting.system.files.directories.md

File metadata and controls

28 lines (28 loc) · 3.84 KB
  • /dev/ : This directory contains device and pseudo-device files.
    • /dev/loop : This pseudo-device allows us to make files accessible as block devices. More.
    • /dev/null : This pseudo-device is the blackhole of the system. Every thing that goes in it is immediately destroyed. More.
    • /dev/random : This pseud-device generates random data.
    • /dev/zero : This pseudo-device generates zeroes.
    • /dev/sda : This device represents a block device (internal hard drive, usb stick, external hard drive). The 1st block device is represented by /dev/sda, the 2nd by /dev/sdb ... More.
    • /dev/sda1 : This device represents the first partition of your /dev/sda hard drive. The 1st partition is represented by /dev/sda1, the 2nd by /dev/sda2 ... More.
  • /etc/ : (Editable Text Configuration) This directory contains global configuration files in text format.
    • /etc/mtab : This file contains all currently mounted file systems.
    • /etc/fstab : This file is generally used to configure filesystems to mount at system boot. More.
    • /etc/passwd : This file is an important Linux file that contains a list of users in the system, plus some users attributes. More
    • /etc/group : This file contains a list of groups, and the members of these groups. More
    • /etc/shadow :This file contains hashed users' passwords.
  • /usr/ (Unix System Resource): This directory contains installed programs and files that are used by users, but which are generally not essential for the proper functioning of the system. More
  • /proc/ : This directory is mounted by Linux, and doesn't really exist on the hard drive. It contains all running processes, and informations about them. More
    • /proc/[xxxxx] : Each directory under /proc/ contains a process informations. The name of each directory matches the PID of a process. More
  • /home/ : Home directory of the users. Every time a new user is created, a directory in the name of user is created within this directory.
  • /media/ : Partitions of internal/external block devices (like Hard drives or USB stick) are mounted in this directory.
  • /var/ : Programs generally stock their global variable data in this directory (like logs, emails ...)
  • /sys/ : This directory is mounted by Linux, and doesn't really exist on the hard drive. It contains informations and configurations settings that the kernel provides for hardware devices.
    For example, we can get network mac address using this cat /sys/class/net/eth0/address, or set the brightness of a monitor using this echo 500 > /sys/class/backlight/acpi_video0/brightness. More
  • /bin/, /sbin/, /usr/bin/, /usr/sbin/ : These directories contains binaries that come with Linux or the ones installed using the package manager. We use these binaries by calling them from the command line (Example : ls, ln, cp ...). We can find these binaries exact location using the command which:
    user@ubuntu:~$ which ls
    /bin/ls
  • /usr/local/bin/, /usr/local/sbin/ : These directories contains binaries installed manually (compiled binaries for example).
  • /boot/ : Holds important files during boot-up process, including Linux Kernel.