The UNIX operating system (OS) is a powerful, multiuser, multitasking system initially developed in the 1970s at Bell Labs. Known for its modular design and portability, UNIX has influenced many modern operating systems, including Linux, MacOS, and BSD variants. At its core, the architecture of UNIX follows a layered structure that provides simplicity, flexibility, and robust control over system resources.
UNIX Architecture
UNIX architecture is broadly divided into three main layers:
- The Kernel
The kernel is the heart of the UNIX operating system. It acts as a bridge between the hardware and user-level processes, handling core tasks such as:
- Process scheduling and management
- Memory management
- Device and I/O management
- File system handling
- System calls
The kernel operates in a privileged mode (kernel mode), ensuring controlled access to hardware and critical system resources.
- The Shell
The shell is the command-line interpreter that allows users to interact with the operating system. It parses and executes user commands, often acting as a scripting environment to automate tasks. Common UNIX shells include:
Each shell provides unique features but offers standard utilities to interface with the kernel.
- Utilities and User Applications
UNIX provides a rich set of small, modular utilities and applications that perform specific tasks, such as file manipulation, text processing, and network communication. These tools adhere to the philosophy of “do one thing and do it well,” and can be chained together using pipes and redirection for complex workflows.
The UNIX file system and directory structure
In addition to these layers, the UNIX file system plays a central role in organizing all system resources—devices, programs, and user data—into a single hierarchical directory structure.
The UNIX directory structure is organized as a single-rooted hierarchical tree, with the root directory (/) at the top. All files and directories branch from this root, creating a consistent and logical organization of system resources. Key directories include:
/
├── bin → Essential user commands (e.g., ls, cp)
├── sbin → System admin commands (e.g., reboot, ifconfig)
├── etc → Configuration files (e.g., passwd, hosts)
├── home → User directories (e.g., /home/simona)
│ ├── simona
│ │ ├── Documents
│ │ └── Downloads
├── lib → Shared libraries required by binaries
├── usr → Secondary hierarchy for user programs
│ ├── bin → Non-essential user commands
│ ├── lib → Libraries for /usr/bin
│ └── local → Locally installed software
├── var → Variable files (logs, mail, spool)
├── tmp → Temporary files
├── dev → Device files (e.g., /dev/sda, /dev/null)
└── proc → Virtual filesystem for processes and kernel info
This structure enforces organization and separation of concerns, making it easier to manage, maintain, and secure the operating system.
Interacting with a UNIX file system
Here are a few common commands you would use to manipulate and explore the UNIX file system structure in a bash shell:
# Print working directory
pwd
# Example output: /home/simona
# List contents of root
ls /
# Navigate to your home directory
cd /home/simona
# Create a new directory
mkdir test_folder
# Navigate into it and create a file
cd test_folder
echo "Sample text" > sample.txt
# View the contents of the file
cat sample.txt
# Find all files under /etc modified in the last day
find /etc -type f -mtime -1
# View process information using the /proc pseudo-filesystem
cat /proc/cpuinfo | head -10
You can find a demo of these and more advanced commands in our quick-start guide to Unix commands.