The UNIX file structure follows a hierarchical directory structure, which is designed to organize files and directories in a systematic manner.
The topmost directory is called the “root directory” and is denoted by a single forward slash “/”.
Here’s a brief explanation of the key directories in the UNIX file structure:
- / (Root Directory):
- The starting point of the file system hierarchy.
- All other directories and files are subdirectories or files contained within the root directory.
- /bin (Binary Programs):
- Contains essential executable binaries (commands) used by both the system and users.
- Common utilities like ls, cp, mv, rm, etc., are found here.
- /sbin (System Binaries):
- Similar to /bin, but contains binaries that are primarily used by the system administrator for system maintenance and management tasks.
- Commands like fdisk, ifconfig, and mount are located here.
- /usr (User Programs and Data):
- Stands for “Unix System Resources.”
- Contains user-related programs, libraries, documentation, and other resources.
- Subdirectories include /usr/bin (user binaries), /usr/lib (libraries), /usr/include (header files), etc.
- /etc (Configuration Files):
- Contains configuration files that control the behavior of various system components and applications.
- Configuration files for services like network settings, user account information, and system startup scripts are found here.
- /home (User Home Directories):
- Each user on the system typically has a home directory located within /home.
- Users can store their personal files and settings in their respective home directories.
- /var (Variable Data):
- Contains variable files, such as log files, temporary files, spool files, and other data that changes frequently during system operation.
- /tmp (Temporary Files):
- A directory to store temporary files used by various programs and processes.
- Files in /tmp are usually deleted automatically on system reboot.
- /dev (Device Files):
- Contains special device files used to communicate with hardware devices.
- These files provide a way for user programs to interact with hardware as if they were accessing regular files.
- /opt (Optional Software Packages):
- Used for installing optional third-party software packages.
- /mnt (Mount Point):
- Used as a temporary mount point for mounting external devices like USB drives, network shares, etc.