Define Linux OS. Explain Its Features
Linux is a free and open-source operating system based on the UNIX operating system. Its source code is freely available, so users can inspect and modify it. Linux can be installed on desktops, servers, smartphones, supercomputers, in-car entertainment systems, and medical devices.
The notes mention that Linux was developed by Linus Torvalds in 1991, inspired by UNIX and MINIX.
Features of Linux Operating System
Explain Components of Linux Operating System
The Linux Operating System is composed of five main components that work together to provide a complete operating system.
Linux Architecture
+------------------+
| Applications |
+------------------+
| GNU Utilities |
+------------------+
| Shell |
+------------------+
| Kernel |
+------------------+
| Hardware |
+------------------+
Explain Shell and Its Types
A Shell is a command-line interpreter that provides an interface between the user and the Linux system. It interprets commands entered by the user and allows them to execute commands, programs and scripts. A collection of commands stored together is known as a Shell Script.
The three important types of shells in the notes are Bash, Zsh and Dash.
Bash is a free and enhanced version of the Bourne Shell and is the default shell on most Linux distributions.
Features: command history, tab completion, command aliasing, job control, arithmetic operations, conditions, loops, functions and strong scripting support.
Zsh is similar to Bash but provides additional and improved features for both command interpretation and shell scripting.
Features: advanced tab completion, themes and plugins, better syntax highlighting and error correction, Bash compatibility and improved globbing.
Dash is a small, fast and POSIX-compliant shell mainly used for executing shell scripts rather than interactive use.
Features: very fast, lightweight, uses little memory, POSIX-compliant, used for scripts and startup tasks, and is the default /bin/sh on many Debian-based systems.
| Shell | Main Feature | Mainly Used For |
|---|---|---|
| Bash | Powerful and widely used | General use & scripting |
| Zsh | Advanced features, themes & plugins | Interactive use & scripting |
| Dash | Fast and lightweight | System/startup scripts |
Explain Linux Directory Structure
The Linux Directory Structure, also known as the File System Hierarchy Standard (FHS), defines a standard way of organizing files and directories in Linux. Linux uses a hierarchical tree structure, where the root directory (/) is at the top and all other files and directories are organized under it.
Linux Directory Structure
/
┌─────────┼─────────┐
/bin /etc /home
│ │ │
/boot /dev /usr
│ │ │
/lib /var /tmp
| Directory | Purpose |
|---|---|
| / | Root directory; top-level directory of the entire file system. |
| /bin | Contains essential command binaries required for basic system operations. |
| /boot | Contains files required for booting the system, such as the kernel and boot-loader configuration. |
| /dev | Contains device files representing hardware such as hard drives and terminals. |
| /etc | Contains system-wide configuration files. |
| /home | Contains home directories of regular users, including their personal files and settings. |
| /lib | Contains shared library files required for running programs. |
| /media | Contains mount points for removable media such as USB drives and CDs. |
| /mnt | Used as a temporary mount point for file systems and storage devices. |
| /opt | Contains additional or add-on application software packages. |
| /root | Home directory of the root user. |
| /sbin | Contains system binaries generally used by the system administrator. |
| /srv | Stores data for services such as web servers and FTP. |
| /tmp | Stores temporary files that are deleted when the system restarts. |
| /usr | Contains most user utilities, applications, and read-only user data. |
| /var | Contains variable data such as logs, spool files, and temporary email files. |
/) directory. Each directory has a specific purpose, making it easier to locate files and manage the Linux system efficiently.
Explain File and Its Types in Linux
In Linux, everything is treated as a file. Files are used to store data, organize information, represent hardware devices and provide communication between processes.
Linux files are broadly classified into three types: Regular Files, Directory Files and Special Files.
ls -l, a regular file is represented by -.ls -l, a directory is represented by d.Identifying File Types
Linux provides commands to identify the type of a file.
file filename
ls -l
Explain Symbolic Link, Hard Link and Pipes
A Symbolic Link (Symlink) acts like a shortcut that points to another file or directory.
A Hard Link associates multiple filenames with the same data block. Thus, different filenames can refer to the same file data.
A Pipe is used for communication between processes. A Named Pipe (FIFO — First In, First Out) can allow two unrelated processes to communicate with each other.