Sunday, October 18, 2026

Linux OS

 


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 का शुभंकर - Tux, AI generated

  • Linux Mascot: A penguin named Tux.

Features of Linux

  1. Open Source: Its source code is available to everyone for free.

  2. Multiuser: Multiple users can access its resources simultaneously.

  3. Multitasking: It can seamlessly perform multiple tasks at the same time.

  4. Security: It provides robust user account and file permission features.

  5. Portable: It can run on various types of hardware architectures.

  6. Networking: It is highly efficient for network and internet-related tasks.

  7. 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

Linux आर्किटेक्चर, AI generated

The architecture of Linux is primarily divided into four layers:

LayerFunction / Component
UserThe person interacting with the system.
Application ProgramsWeb browsers, text editors, media players, etc.
Shell / GUIReceives commands and instructions from the user.
KernelCore system that manages CPU, memory, devices, and processes.
HardwarePhysical 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:

  1. KDE Plasma: A highly popular Desktop Environment in Linux. It offers panels, menus, icons, and extensive customization features.

  2. 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:

  1. Press the computer's Power Button.

  2. The system will load the Linux OS (Boot process).

  3. When the Login Screen appears, enter your Username and Password.

  4. 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):

    Bash
    sudo 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

  1. File names can consist of letters, numbers, and certain special characters.

  2. Linux is Case-Sensitive (e.g., File.txt and file.txt are treated as two entirely different files).

  3. The forward slash / cannot be used inside a file name, as it is the directory separator.

  4. Spaces are allowed in file names, but when using commands, files with spaces must be enclosed in quotes (" ").

  5. File Extensions (like .txt or .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.

CharacterFunctionExample
*Matches zero or more charactersls *.txt
?Matches exactly one single characterls file?.txt
[abc]Matches any one of the enclosed charactersls file[123].txt
[0-9]Matches any one character from the specified rangels 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 .., not cd \)

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). Press q to 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:

  1. Command Mode: This is the default mode when you open vi. It is used for copying, pasting, and deleting text.

  2. Insert Mode (Input Mode): This mode allows you to type and edit text. Press i to enter this mode, and press Esc to return to Command Mode.

  3. Last-Line Mode (Ex Mode): Used for saving files and exiting the editor. Activated by pressing : while in Command Mode.

Useful vi Commands:

CommandFunction
iEnter Insert Mode
EscReturn to Command Mode from Insert Mode
:wSave the file
:qQuit the editor
:wqSave and quit
:q!Quit without saving changes
ddDelete the current line
yyCopy (yank) the current line
pPaste the copied/deleted text

Messaging Commands in Linux

These commands are used to communicate with other users logged into the same system or network.

  1. who: Shows who is currently logged in (useful for knowing who you can message).

  2. mesg y / mesg n: Allows (y) or denies (n) permission to receive messages from others on your terminal.

  3. wall "message": Broadcasts a message to all logged-in users' terminals.

  4. write username: Sends a message to a specific logged-in user. (Press Ctrl+D to end the message).

  5. talk username: Initiates a two-way, interactive live text chat between two users (requires the talk package to be installed).

Linux OS (hindi)

 

Linux Operating System 

Linux एक Open Source Operating System है, जो कंप्यूटर के हार्डवेयर और उपयोगकर्ता के बीच संपर्क स्थापित करता है। यह कंप्यूटर के संसाधनों तथा प्रोग्रामों को नियंत्रित करता है।

  • उदाहरण: Ubuntu, Fedora, Debian और Linux Mint।

  • विकासकर्ता: Linus Torvalds

  • विकास वर्ष: 1991

  • प्रमुख विशेषता: Linux का सोर्स कोड उपलब्ध होता है, जिसे इसके लाइसेंस के अनुसार उपयोग, संशोधित और वितरित किया जा सकता है।

  • Linux का शुभंकर (Mascot): Tux नाम का पेंगुइन है।

Linux की विशेषताएँ

  1. Open Source: इसका सोर्स कोड सभी के लिए मुफ्त में उपलब्ध होता है।

  2. Multiuser: कई उपयोगकर्ता एक साथ इसके संसाधनों का उपयोग कर सकते हैं।

  3. Multitasking: एक समय में कई कार्य (Tasks) आसानी से कर सकता है।

  4. Security: उपयोगकर्ता खातों और अनुमतियों (Permissions) की मजबूत सुविधा देता है।

  5. Portable: विभिन्न प्रकार के हार्डवेयर पर चल सकता है।

  6. Networking: नेटवर्क और इंटरनेट से संबंधित कार्यों में बेहद उपयोगी है।

  7. Stability: सर्वर और अन्य लंबे समय तक चलने वाली प्रणालियों में इसका व्यापक उपयोग किया जाता है।

Linux की कमियाँ

  • कुछ प्रचलित प्रोग्राम और गेम Linux पर उपलब्ध नहीं होते।

  • कुछ नए हार्डवेयर के ड्राइवर स्थापित करना कठिन हो सकता है।

  • नए उपयोगकर्ताओं को कमांड (CLI) सीखने में समय लग सकता है।

  • कुछ विशेष सॉफ्टवेयर केवल Windows या अन्य ऑपरेटिंग सिस्टम के लिए ही बनाए जाते हैं।

Linux की संरचना (Architecture)

Linux का आर्किटेक्चर मुख्य रूप से चार परतों (Layers) में बँटा होता है:

स्तरकार्य / घटक
User / उपयोगकर्तासिस्टम का उपयोग करने वाला व्यक्ति।
Application Programsब्राउज़र, एडिटर आदि।
Shell / GUIउपयोगकर्ता से निर्देश प्राप्त करता है।
Kernel (कर्नेल)CPU, मेमोरी, डिवाइस और प्रक्रियाओं का प्रबंधन।
Hardware / हार्डवेयरCPU, RAM, डिस्क, कीबोर्ड आदि भौतिक उपकरण।
  • Kernel (कर्नेल): Kernel Linux का मुख्य भाग (Core) है। यह हार्डवेयर, मेमोरी, CPU, फाइलों और चल रहे प्रोग्रामों के संसाधनों का प्रबंधन करता है।

  • Shell (शेल): Shell उपयोगकर्ता और Kernel के बीच कमांड इंटरप्रेटर का कार्य करता है। यह उपयोगकर्ता से कमांड लेकर उन्हें निष्पादित (Execute) करने में सहायता करता है। (उदाहरण: Bash, Zsh)

ध्यान दें: GUI के माध्यम से भी Linux का उपयोग किया जा सकता है; हर कार्य के लिए Shell कमांड आवश्यक नहीं है।

 Linux का GUI (Graphical User Interface)

GUI एक ऐसा इंटरफेस है, जिसमें उपयोगकर्ता आइकन, मेन्यू, विंडो और माउस की सहायता से कंप्यूटर चलाता है।

  • इसमें आइकन, विंडो और मेन्यू होते हैं।

  • कमांड याद रखने की आवश्यकता कम होती है।

  • फाइलें खोलना, कॉपी करना और हटाना आसान होता है।

Linux के Desktop Environment

Desktop Environment आपके Linux सिस्टम का पूरा लुक और फील तय करते हैं:

  1. KDE Plasma: यह Linux का एक लोकप्रिय Desktop Environment है। इसमें पैनल, मेन्यू, आइकन और कई प्रकार की Customization सुविधाएँ होती हैं।

  2. GNOME: इसका इंटरफेस बहुत ही सरल, आधुनिक और उपयोग में आसान है।

Linux को चालू (Start) और बंद (Shut Down) करने की विधि

चालू करने की विधि:

  1. कंप्यूटर का Power Button दबाएँ।

  2. सिस्टम Linux को लोड करेगा।

  3. Login Screen आने पर Username और Password दर्ज करें।

  4. Login करने के बाद Desktop दिखाई देगा।

बंद करने की विधि:

  • GUI द्वारा: System Menu में Power Off या Shut Down विकल्प चुनें।

  • Terminal द्वारा: उचित अनुमति के साथ निम्न कमांड का उपयोग करें:

    Bash
    sudo shutdown -h now
    

Linux का File System Structure

Linux में सभी फाइलें और डायरेक्टरी एक मुख्य डायरेक्टरी / (Root Directory) के अंतर्गत व्यवस्थित होती हैं।

  • / — Root Directory

  • /home — उपयोगकर्ताओं की व्यक्तिगत फाइलें

  • /bin — आवश्यक कमांड के प्रोग्राम

  • /etc — सिस्टम कॉन्फिगरेशन फाइलें

  • /dev — डिवाइस फाइलें

  • /tmp — अस्थायी फाइलें

  • /var — लॉग और बदलने वाला डेटा

फाइल बनाने के नियम

  1. फाइल का नाम अक्षरों, अंकों और कुछ विशेष चिह्नों से बनाया जा सकता है।

  2. Linux Case-Sensitive है (अर्थात File.txt और file.txt अलग-अलग माने जाएँगे)।

  3. / का उपयोग फाइल के नाम के अंदर नहीं किया जा सकता।

  4. फाइल के नाम में स्पेस हो सकता है, लेकिन कमांड में स्पेस वाले नाम को उद्धरण चिह्नों (" ") में लिखना सुविधाजनक होता है।

  5. फाइल का Extension (जैसे .txt या .c) वैकल्पिक (Optional) है।

फाइलों के प्रकार

  1. Regular File: सामान्य डेटा या प्रोग्राम की फाइल।

  2. Directory File: अन्य फाइलों और डायरेक्टरी की सूची रखती है।

  3. Device File: हार्डवेयर डिवाइस तक पहुँच प्रदान करती है।

  4. Symbolic Link: किसी दूसरी फाइल या डायरेक्टरी का शॉर्टकट।

Linux में Wildcard Characters

Wildcard का उपयोग फाइलों के नाम खोजने या एक साथ कई फाइलों को चुनने के लिए किया जाता है।

चिन्ह

कार्य

उदाहरण

*

शून्य या अधिक अक्षरों से मेल

ls *.txt

?

किसी एक अक्षर से मेल

ls file?.txt

[abc]

दिए गए अक्षरों में से किसी एक से मेल

ls file[123].txt

[0-9]

दिए गए अक्षर-समूह में से किसी एक से मेल

ls file[0-9].txt

Linux के प्रमुख Commands (CLI)

CLI (Command Line Interface) में उपयोगकर्ता Terminal में कमांड लिखकर कंप्यूटर को निर्देश देता है।

A. डायरेक्टरी संबंधी कमांड

  • pwd: वर्तमान कार्यशील डायरेक्टरी का Path दिखाता है।

  • mkdir directory_name: नई डायरेक्टरी बनाता है (जैसे: mkdir School)।

  • rmdir directory_name: खाली डायरेक्टरी को हटाता है।

  • cd directory_name: एक डायरेक्टरी से दूसरी में जाने के लिए (जैसे: cd School)।

  • cd /: सीधे Root Directory में जाने के लिए।

  • cd ..: वर्तमान डायरेक्टरी से एक स्तर ऊपर जाने के लिए। (ध्यान दें: Linux में cd \ नहीं बल्कि cd .. का उपयोग होता है)

B. फाइल संबंधी कमांड

  • touch filename: नई खाली फाइल बनाने के लिए (जैसे: touch notes.txt)।

  • cat filename: फाइल की सामग्री देखने के लिए।

  • cp source destination: फाइल कॉपी करने के लिए (जैसे: cp notes.txt copy.txt)।

  • mv source destination: फाइल का नाम बदलने या उसे मूव करने के लिए।

  • rm filename: फाइल हटाने के लिए (इससे हटी फाइल Trash में नहीं जाती)।

C. उपयोगकर्ता और सहायता संबंधी कमांड

  • who: लॉगिन किए हुए उपयोगकर्ताओं की जानकारी दिखाता है।

  • man command_name: किसी कमांड का Manual (सहायता) दिखाता है (जैसे: man ls)। बाहर निकलने के लिए q दबाएँ।

  • more filename: लंबी फाइल की सामग्री को स्क्रीन-दर-स्क्रीन दिखाता है।

  • clear: Terminal स्क्रीन को साफ करता है।

D. तारीख और गणना संबंधी कमांड

  • date: वर्तमान तारीख और समय दिखाता है।

  • cal 2026: वर्ष 2026 का कैलेंडर दिखाता है।

  • wc filename: फाइल में लाइनों, शब्दों और अक्षरों की संख्या गिनता है (केवल शब्द गिनने के लिए: wc -w notes.txt)।

  • sort filename: फाइल की लाइनों को अक्षरानुक्रम में व्यवस्थित करता है।

  • head -n 5 filename: फाइल की शुरुआती 5 लाइनें दिखाता है।

  • tail -n 5 filename: फाइल की अंतिम 5 लाइनें दिखाता है।

 vi Text Editor

vi Linux का एक Terminal आधारित Text Editor है। खोलने का तरीका: vi notes.txt

vi Editor के 3 प्रमुख Modes:

  1. Command Mode: vi खोलने पर यह डिफ़ॉल्ट रूप से सक्रिय होता है। (कॉपी, पेस्ट, डिलीट के लिए)।

  2. Insert Mode (Input Mode): इसमें टेक्स्ट लिखा जाता है। जाने के लिए i दबाएँ और वापस Command Mode में आने के लिए Esc दबाएँ।

  3. Last-Line Mode (Ex Mode): सेव करने और बाहर निकलने के लिए। Command Mode में : दबाने पर सक्रिय होता है।

vi के उपयोगी कमांड्स:

कमांडकार्य
iInsert Mode में जाना
EscInsert Mode से Command Mode में आना
:wफाइल सेव करना
:qएडिटर से बाहर निकलना
:wqसेव करके बाहर निकलना
:q!बिना बदलाव सेव किए बाहर निकलना
ddवर्तमान लाइन हटाना
yyवर्तमान लाइन कॉपी करना
pपेस्ट करना

Linux में Messaging Commands

इनका उपयोग एक ही सिस्टम या नेटवर्क पर जुड़े उपयोगकर्ताओं के बीच संदेश भेजने के लिए किया जाता है।

  1. who: लॉगिन उपयोगकर्ताओं की जानकारी दिखाता है।

  2. mesg y / mesg n: संदेश प्राप्त करने की अनुमति देना (y) या रोकना (n)।

  3. wall "message": सिस्टम के सभी उपयुक्त लॉगिन टर्मिनल पर संदेश प्रसारित करता है।

  4. write username: किसी विशिष्ट उपयोगकर्ता को संदेश भेजने के लिए। (संदेश समाप्त करने के लिए Ctrl+D दबाएँ)।

  5. talk username: दो उपयोगकर्ताओं के बीच लाइव टेक्स्ट बातचीत की सुविधा (यदि पैकेज स्थापित हो)।

Linux OS

  Linux Operating System Linux is an Open Source Operating System that establishes a connection between computer hardware and the user. It c...