Linux Fundamentals
What is Linux?
Linux is an open-source operating system that has become increasingly popular in the computing world. It is known for its stability, security, and flexibility, making it a preferred choice for a wide range of applications, from servers and supercomputers to personal computers and embedded systems.
The Linux Kernel
The Linux kernel is the core of the Linux operating system. It is responsible for managing system resources, such as memory, CPU, and peripherals, as well as providing a interface for applications to interact with the hardware.
graph TD
A[Linux Kernel] --> B[Memory Management]
A --> C[Process Management]
A --> D[Device Drivers]
A --> E[File System]
A --> F[Network Stack]
Linux Distributions
Linux is available in various distributions, each with its own set of features, tools, and package management systems. Some popular Linux distributions include Ubuntu, Debian, Fedora, CentOS, and Arch Linux.
Distribution |
Based on |
Package Manager |
Ubuntu |
Debian |
apt |
Fedora |
Red Hat |
dnf |
CentOS |
Red Hat |
yum |
Arch Linux |
- |
pacman |
The Linux Shell
The Linux shell, or command-line interface (CLI), is a powerful tool that allows users to interact with the operating system, automate tasks, and perform advanced system administration tasks. The most commonly used shell is Bash (Bourne-Again SHell).
## Example Bash commands
ls -l ## List files and directories
mkdir my_directory ## Create a new directory
nano my_file.txt ## Open a file in the Nano text editor
Linux File System
The Linux file system is a hierarchical structure that organizes files and directories. The root directory, denoted by /
, is the top-level directory, and all other directories and files are organized under it.
graph TD
A[/] --> B[/bin]
A --> C[/etc]
A --> D[/home]
A --> E[/usr]
A --> F[/var]
Linux Permissions
Linux has a robust system of permissions that control who can access and modify files and directories. Each file and directory has three types of permissions: read, write, and execute.
## Example permission settings
-rw-r--r-- 1 user group 1024 Apr 1 12:34 my_file.txt
drwxr-xr-x 2 user group 4096 Apr 1 12:34 my_directory/