Overview
Ubuntu, like many Linux distributions, follows the Filesystem Hierarchy Standard (FHS), which defines the structure and layout of the file system. Here’s an overview of some key directories in the Ubuntu filesystem:
spaceforit@spaceforit:/$ ls -1 bin boot dev etc home lib lib32 lib64 libx32 lost+found media mnt opt proc root run sbin snap srv swap.img sys tmp usr var
1. /
(Root Directory):
- The root directory is the top-level directory in the filesystem hierarchy. All other directories and files are subdirectories or files contained within the root directory.
2. /bin
(Binary Binaries):
- Essential binary executables (commands) that are required for system repair and recovery. Common commands used by all users are stored here.
3. /boot
(Boot Loader Files):
- Contains files necessary for the boot process, including the Linux kernel, initial ramdisk, and bootloader configuration files.
4. /dev
(Device Files):
- Contains device files representing hardware devices. These files allow access to devices and peripherals connected to the system.
5. /etc
(System Configuration Files):
- Hosts configuration files and scripts that are used by system-wide applications. System administrators can modify these files to configure various aspects of the system.
6. /home
(User Home Directories):
- Home directories for individual users. Each user has a subdirectory within
/home
where they can store personal files and configurations.
7. /lib
(Library Files):
- Essential shared libraries required for the basic functioning of system programs. Subdirectories like
/lib32
and/lib64
may exist for 32-bit and 64-bit libraries, respectively.
8. /media
and /mnt
(Mount Points):
- Directories used for temporarily mounting filesystems, external drives, or removable media.
/media
is often used for automatically mounted devices, while/mnt
is a general-purpose mount point.
9. /opt
(Optional Packages):
- Contains subdirectories for optional software packages. Some third-party applications may be installed here.
- Optional I am saving my scripts in this location
10. /proc
(Process Information):
- A virtual filesystem that provides information about running processes and system resources as files. It is used by various system utilities and is not a real filesystem.
11. /root
(Root User Home):
- The home directory for the root user. The root user is the superuser with administrative privileges.
12. /sbin
(System Binaries):
- Similar to
/bin
, this directory contains essential system binaries. The binaries here are typically used by the system administrator for system maintenance and repair.
13. /srv
(Service Data):
- Contains data used by services provided by the system. For example, web servers may store their data files in subdirectories under
/srv
.
14. /tmp
(Temporary Files):
- A directory for temporary files created by system and user processes. Files in this directory are often deleted on system reboot.
15. /usr
(User Binaries and Libraries):
- Contains subdirectories with binaries, libraries, documentation, and source code for installed programs. User-related programs and data are typically stored here.
16. /var
(Variable Files):
- Contains variable files such as log files, spool files, and temporary files that may change in size and content during the normal operation of the system.
Understanding the purpose of these directories is essential for managing and troubleshooting a Linux system effectively. Each directory plays a specific role in organizing the file system and supporting the functioning of the operating system and applications.