Ubuntu Filesystem Structure
Root Directory "/"
In Linux, "/" represents the root directory, and all directories are derived starting from the root directory.
Common Directories and Their Functions
/bin
- Stores binary executable files, which can be used even in single-user mode. They can be used by both the root user and ordinary accounts.
/boot
- Contains the Ubuntu kernel and boot files, such as
vmlinuz-xxxand the GRUB boot loader.
/dev
- Stores device files, used for interaction between the system and devices.
/etc
- Contains system configuration files, such as user account and password files, service configuration files, etc.
/home
- The system's default user home directory. When a new user account is created, its home directory is created here by default.
/lib
- Stores library files, which are the dynamically linked shared libraries required when executable files run.
/media
- Provides mount points for removable storage devices, such as SD cards and USB drives.
/mnt
- Provides mount points for users to mount temporary filesystems.
/opt
- Stores optional application software packages, usually third-party applications.
/root
- The home directory of the root user, that is, the home directory of the system administrator.
/sbin
- Stores essential programs for system administration and maintenance, similar to
/binbut mainly used during system startup and recovery.
/srv
- Service data directory, storing data related to services.
/sys
- A virtual filesystem that provides an interface between the kernel and user space.
/tmp
- Temporary file directory, used to store temporary files.
/var
- Stores frequently changing files, such as log files.
/usr
- UNIX software resources, not users' personal files, storing applications and files widely used by the system.
/proc
- A virtual filesystem that stores runtime system information and kernel information, directly stored in memory.
Absolute Paths and Relative Paths
Absolute Path
- A complete path starting from the root directory "/", for example
/home/user/test/.
Relative Path
- A path relative to the current working directory. For example,
./test/represents thetestdirectory under the current directory, and..\represents the parent directory.