Linux Operating System
Original Scanned PDF – View Notes
Introduction to Linux
- Linux is an open-source, Unix-like operating system.
- It is known for stability, security, flexibility and performance.
- Linux is widely used on servers, desktop computers, embedded systems, supercomputers and mobile devices.
- It supports multitasking, multiple users, networking and a hierarchical file system.
History of Linux
- Linux was started by Linus Torvalds while he was a student at the University of Helsinki.
- It was inspired by Unix-like systems and was developed as a freely available operating system kernel.
- Over time, developers around the world contributed to Linux and many Linux distributions were created.
Features of Linux
Multiuser
Multiple users can use the resources of a Linux system.
Multitasking
Linux can run many programs and processes at the same time.
Open Source
The source code is available and can be studied, modified and distributed.
Portable
Linux can run on many different hardware platforms and processor architectures.
Secure
User accounts, file ownership and permissions help protect the system.
Networking
Linux includes strong networking tools and is widely used for server systems.
Linux Architecture
A Linux system can be understood as a layered structure consisting of hardware, kernel, shell and applications.
Hardware
Physical components such as CPU, memory, storage, network devices and input/output devices.
Kernel
The core part of Linux that manages system resources and communicates with hardware.
Shell
The command interpreter that provides an interface between the user and the kernel.
Applications
User programs and system programs that use services provided by the operating system.
Linux Kernel
The Linux kernel is the core component of the Linux operating system. It manages the hardware and provides services required by programs.
Main Functions of the Kernel
- Process Management: controls processes and CPU scheduling.
- Memory Management: manages RAM and virtual memory.
- Device Management: communicates with devices through device drivers.
- File System Management: manages files, directories and storage.
- System Calls: provides a controlled interface through which applications request operating system services.
- Security: controls access to system resources.
Linux Distributions
A Linux distribution is a complete operating system built around the Linux kernel together with utilities, libraries, package-management tools and applications.
| Distribution | Common Use |
|---|---|
| Ubuntu | Desktop, education and server use |
| Debian | Stable general-purpose systems and servers |
| Fedora | Desktop and newer Linux technologies |
| Red Hat Enterprise Linux | Enterprise servers |
| CentOS / compatible enterprise distributions | Server environments |
| Kali Linux | Security testing and cybersecurity learning |
Linux File System
- Linux uses a hierarchical file-system structure.
- The topmost directory is called the root directory and is represented by
/. - Files, folders and devices are organized under the root directory.
- Linux commonly uses file systems such as ext4, XFS and Btrfs.
Important Linux Directories
| Directory | Purpose |
|---|---|
/ | Root of the Linux file system. |
/home | Contains personal directories of normal users. |
/root | Home directory of the root user. |
/bin | Contains essential user commands and executable files. |
/etc | Contains system configuration files. |
/usr | Contains user applications, libraries and shared files. |
/var | Contains variable data such as logs and spool files. |
/tmp | Stores temporary files. |
/dev | Contains device files. |
/boot | Contains files required for the boot process. |
/media | Used as a mount point for removable media. |
/mnt | Commonly used for temporary manual mounting. |
Basic Linux Commands
| Command | Function | Example |
|---|---|---|
pwd | Shows the present working directory. | pwd |
ls | Lists files and directories. | ls -la |
cd | Changes the current directory. | cd /home |
mkdir | Creates a new directory. | mkdir notes |
rmdir | Removes an empty directory. | rmdir notes |
touch | Creates an empty file or updates a file timestamp. | touch file.txt |
cp | Copies files or directories. | cp a.txt b.txt |
mv | Moves or renames files and directories. | mv old.txt new.txt |
rm | Removes files. | rm file.txt |
cat | Displays file contents. | cat file.txt |
clear | Clears the terminal screen. | clear |
man | Displays the manual page of a command. | man ls |
Linux File Permissions
Linux controls access to files and directories using permissions.
Permissions are normally defined for three categories:
- User / Owner
- Group
- Others
Example: rwxr-xr--
The owner has read, write and execute permission; the group has read and execute permission; others have read permission only.
The chmod command is used to change file permissions.
User and Group Management
Linux is a multiuser operating system. Different users can have separate accounts, passwords, files and permissions.
| Command | Purpose |
|---|---|
useradd | Create a user account. |
userdel | Delete a user account. |
passwd | Set or change a password. |
groupadd | Create a group. |
whoami | Display the current user name. |
Process Management in Linux
- A running program is called a process.
- Each process has a unique Process ID (PID).
- Linux can run foreground and background processes.
- Process-management commands help users view, monitor and stop processes.
| Command | Function |
|---|---|
ps | Shows process information. |
top | Displays running processes and system activity. |
kill | Sends a signal to a process, commonly to terminate it. |
nice | Starts a process with a selected scheduling priority. |
Package Management
Linux distributions use package managers to install, update and remove software.
- Debian and Ubuntu commonly use
apt. - Fedora commonly uses
dnf. - Red Hat based systems may use
dnfor olderyumtools. - Arch Linux uses
pacman.
Shell and Shell Scripting
- The shell is a command interpreter and interface between the user and the Linux kernel.
- Common shells include Bash, Zsh and Sh.
- A shell script is a file containing a sequence of commands that can be executed automatically.
- Shell scripts are commonly used to automate repetitive system tasks.
Networking in Linux
Linux provides strong networking support and is widely used for web servers, database servers, cloud systems and network services.
| Command | Use |
|---|---|
ip | View and manage network interfaces and routes. |
ping | Test network connectivity. |
ssh | Connect securely to a remote system. |
scp | Copy files securely between systems. |
Security in Linux
- User authentication through login accounts and passwords.
- Authorization through file ownership and read, write and execute permissions.
- Encryption for protecting data.
- Regular system updates and package management.
- Firewall and access-control tools can be used to secure network services.
Advantages of Linux
- Free and open source.
- Stable and reliable.
- Secure user and file-permission model.
- Supports multitasking and multiple users.
- Highly customizable.
- Efficient use of hardware resources.
- Strong networking support.
- Many distributions are available for different purposes.
Applications of Linux
- Web and database servers
- Cloud computing
- Supercomputers
- Embedded and IoT systems
- Cybersecurity and penetration-testing environments
- Software-development systems
- Desktop computing
- Android and other Linux-kernel-based devices
Discussion
Share a helpful question, idea, or explanation with other students.