Unix System Architecture and Unix File System Structure
The architecture of this operating system is four layered. Unix system architecture consists of Hardware, Kernel, System Call interface(shell) commands and utilities, user applications etc. In Unix, all files are organized into directories. Files in Unix System are organized into multi-level hierarchy structure known as a directory tree.
We will learn below topics in this article:
Unix System Architecture
A computer system contains hardware and software that controls and manage computer hardware, software resources, and Operating system required for the computer. The operating system acts as the intermediate between hardware and the user-defined application software. Unix is a multitasking, multiuser operating system.
The software is of two types:
- System software
- Application software.
The system software provides platform for other software on the computer.Application Software is user-defined software that works on the system software. An operating system is a system software.
The Unix system architecture is divided by into four layers.
Major components of Unix System architecture are :
- Commands and Utilities
- User Applications
Kernel is the central core that interacts directly with the hardware of the system.
The main functions of Kernel are:
- Computer hardware such as memory, disc, printers are controlled by the kernel.
- The kernel schedules the processes, control and executes various user-defined tasks.
- Manages the data storage
It is the interface between the user and the kernel. Users can interact with the shell using shell commands.
- Users communicate directly with Shell.Translates user’s commands into functions understandable by Kernel
- It interprets commands given by the users and executes them using the kernel.
- Issues a shell prompt and waits for user response
- Provides programming ability to the users to write shell commands .
Commands and Utilities
Commands used by the Unix operating system are:
- ‘sh’ – shell commands providing a primary user interface,
- There are various commands and utilities which you can make use of in your day to day activities. cp, mv, cat and grep
All the data/programs which the user writes.
Unix File System Structure
Files in Unix System are organized into multi-level hierarchy structure known as a directory tree. At the top of the file system is a directory called “root” which is represented by a “/”
- A file is a smallest unit in which the information is stored.
- All data in Unix is organized into files. All files are organized into directories. Unix has multiple file systems
- A file system is a formatted partition of the disk ,group of files having relevant information
- There is always one compulsory file system known as the root.
- For more information
Features of the Unix file management system :
- It implements a hierarchical directory structure of the file name space.
- It implements a uniform and consistent treatment of file data and other I/O objects.
- It implements a means of sharing file data.
- It implements a means of protecting file data.
- Keeps track of files using i-node numbers.
- File access permissions can be set 3 classes of users:
- File Owner
- File Owner’s Group
Absolute and Relative Path
What is a Path?A path is a unique location to a file or a folder in a file system of an OS. A path to a file is a combination of / and alpha-numeric characters.
What Is An Absolute Path?An absolute path is defined as specifying the location of a file or directory from the root directory(/). In other words absolute path is a complete path from start of the actual file system from / directory.
Some examples of absolute path:/home/base/myData/test.config /home/base/myData/queries.sql
What Is The Relative Path?Relative path is defined as a path related to the present working directory(pwd). Suppose I am located in /home/base and I want to change directory to /home/base/myData. I can use relative path concept to change directory to myData Changing directory using relative path:
Syntax:$pwd /home/base $cd myData
Change directory using absolute path:$cd /home/base/myData Note: We can use absolute path from any location where as if you want to use relative path we should be present in a directory where we are going to specify relative to that present working directory.
|cd ./myData||Change current directory to myData||Use relative path|
|cd ..||Change current directory to parent directory||Use relative path|
|cd /home/base/myData||Change current directory to dir1||Use absolute path|