Linux Operating System
Linux is an Open Source Operating System that establishes a connection between computer hardware and the user. It controls and manages the computer's resources and programs.
Examples: Ubuntu, Fedora, Debian, and Linux Mint.
Developer: Linus Torvalds
Year of Development: 1991
Key Feature: The source code of Linux is freely available, meaning it can be used, modified, and distributed according to its license.
Linux Mascot: A penguin named Tux.
Features of Linux
Open Source: Its source code is available to everyone for free.
Multiuser: Multiple users can access its resources simultaneously.
Multitasking: It can seamlessly perform multiple tasks at the same time.
Security: It provides robust user account and file permission features.
Portable: It can run on various types of hardware architectures.
Networking: It is highly efficient for network and internet-related tasks.
Stability: It is widely used in servers and systems that require long, uninterrupted uptimes.
Disadvantages of Linux
Some popular commercial programs and games are not available on Linux.
Installing drivers for certain new or proprietary hardware can be difficult.
New users may take time to learn and get comfortable with the Command Line Interface (CLI).
Some specific software is developed exclusively for Windows or macOS.
Linux Architecture
The architecture of Linux is primarily divided into four layers:
| Layer | Function / Component |
| User | The person interacting with the system. |
| Application Programs | Web browsers, text editors, media players, etc. |
| Shell / GUI | Receives commands and instructions from the user. |
| Kernel | Core system that manages CPU, memory, devices, and processes. |
| Hardware | Physical components like CPU, RAM, Disk, Keyboard, etc. |
Kernel: The Kernel is the core part of Linux. It manages hardware, memory, CPU, files, and the resources of running programs.
Shell: The Shell acts as a command interpreter between the User and the Kernel. It takes commands from the user and helps execute them. (Examples: Bash, Zsh)
Note: Linux can also be operated entirely via a GUI; Shell commands are not strictly mandatory for every everyday task.
6. Linux GUI (Graphical User Interface)
A GUI is an interface where the user operates the computer using icons, menus, windows, and a mouse.
It consists of visual elements like icons, windows, and menus.
It reduces the need to memorize complex commands.
Tasks like opening, copying, and deleting files become highly intuitive.
7. Linux Desktop Environments
Desktop Environments determine the complete look and feel of your Linux system:
KDE Plasma: A highly popular Desktop Environment in Linux. It offers panels, menus, icons, and extensive customization features.
GNOME: Features a very simple, modern, and user-friendly interface that focuses on a distraction-free workflow.
How to Start and Shut Down Linux
Startup Process:
Press the computer's Power Button.
The system will load the Linux OS (Boot process).
When the Login Screen appears, enter your Username and Password.
After logging in, the Desktop will be displayed.
Shutdown Process:
Via GUI: Open the System Menu and select the Power Off or Shut Down option.
Via Terminal: Use the following command (requires appropriate permissions):
Bashsudo shutdown -h now
Linux File System Structure
In Linux, all files and directories are organized under a single main directory called / (Root Directory).
/— Root Directory/home— Personal files and directories of standard users/bin— Essential command binaries/programs/etc— System configuration files/dev— Device files (hardware representations)/tmp— Temporary files/var— Variable data (like system logs)
File Naming Rules
File names can consist of letters, numbers, and certain special characters.
Linux is Case-Sensitive (e.g.,
File.txtandfile.txtare treated as two entirely different files).The forward slash
/cannot be used inside a file name, as it is the directory separator.Spaces are allowed in file names, but when using commands, files with spaces must be enclosed in quotes (
" ").File Extensions (like
.txtor.c) are strictly optional in Linux.
File Types
Regular File: Standard data, text, or program files.
Directory File: A folder that contains lists of other files and directories.
Device File: Provides access to hardware devices.
Symbolic Link: A shortcut or reference to another file or directory.
Wildcard Characters in Linux
Wildcards are used to search for file names or to select multiple files simultaneously in the terminal.
| Character | Function | Example |
| * | Matches zero or more characters | ls *.txt |
| ? | Matches exactly one single character | ls file?.txt |
| [abc] | Matches any one of the enclosed characters | ls file[123].txt |
| [0-9] | Matches any one character from the specified range | ls file[0-9].txt |
Key Linux Commands (CLI)
In the CLI (Command Line Interface), the user issues instructions to the computer by typing commands into a Terminal.
A. Directory Commands
pwd: Prints the full path of the Present Working Directory.
mkdir directory_name: Creates a new directory (e.g.,
mkdir School).rmdir directory_name: Removes an empty directory.
cd directory_name: Changes the directory (e.g.,
cd School).cd /: Takes you directly to the Root Directory.
cd ..: Moves you one level up from the current directory. (Note: Linux uses
cd .., notcd \)
B. File Commands
touch filename: Creates a new empty file or updates an existing file's timestamp (e.g.,
touch notes.txt).cat filename: Displays the contents of a file on the screen.
cp source destination: Copies a file or directory (e.g.,
cp notes.txt copy.txt).mv source destination: Moves or renames a file or directory.
rm filename: Deletes a file. (Files deleted this way bypass the Trash bin).
C. User & Help Commands
who: Displays information about users currently logged into the system.
man command_name: Shows the Manual page for a command (e.g.,
man ls). Pressqto exit.more filename: Displays the contents of a long file one screen at a time.
clear: Clears the Terminal screen.
D. Date & Text Processing Commands
date: Displays the current system date and time.
cal 2026: Displays the calendar for the year 2026.
wc filename: Counts lines, words, and characters in a file (To count only words:
wc -w notes.txt).sort filename: Sorts the lines of a text file in alphabetical order.
head -n 5 filename: Displays the first 5 lines of a file.
tail -n 5 filename: Displays the last 5 lines of a file.
vi Text Editor
vi is a powerful Terminal-based text editor built into Linux.
How to open: vi notes.txt
3 Main Modes of vi Editor:
Command Mode: This is the default mode when you open
vi. It is used for copying, pasting, and deleting text.Insert Mode (Input Mode): This mode allows you to type and edit text. Press
ito enter this mode, and pressEscto return to Command Mode.Last-Line Mode (Ex Mode): Used for saving files and exiting the editor. Activated by pressing
:while in Command Mode.
Useful vi Commands:
| Command | Function |
| i | Enter Insert Mode |
| Esc | Return to Command Mode from Insert Mode |
| :w | Save the file |
| :q | Quit the editor |
| :wq | Save and quit |
| :q! | Quit without saving changes |
| dd | Delete the current line |
| yy | Copy (yank) the current line |
| p | Paste the copied/deleted text |
Messaging Commands in Linux
These commands are used to communicate with other users logged into the same system or network.
who: Shows who is currently logged in (useful for knowing who you can message).
mesg y/mesg n: Allows (y) or denies (n) permission to receive messages from others on your terminal.wall "message": Broadcasts a message to all logged-in users' terminals.
write username: Sends a message to a specific logged-in user. (Press
Ctrl+Dto end the message).talk username: Initiates a two-way, interactive live text chat between two users (requires the talk package to be installed).