0% found this document useful (0 votes)
28 views12 pages

Linux Unit 1

Uploaded by

bachhrajyashu28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views12 pages

Linux Unit 1

Uploaded by

bachhrajyashu28
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

History of Linux & Unix

The history of Linux and Unix is intertwined, as Linux was inspired by Unix and shares many of its
principles.

1. Unix
 Origins (1969):
Unix was developed at Bell Labs by Ken Thompson, Dennis Ritchie, and others. It was initially
created as a simple, multi-tasking system for the PDP-7 minicomputer.

 Goals:

 A simple, portable, and multi-user operating system.

 Designed with a hierarchical file system and tools philosophy: "Do one thing, do it well."

 Key Developments:

 1973: Unix was rewritten in C, making it portable to other hardware systems.

 1975: Bell Labs released Unix under a license for universities, fostering widespread
adoption in academia.

 1980s: Variants like BSD (Berkeley Software Distribution) emerged, influencing modern
systems.

 Influence:
Unix became the foundation for many operating systems, including Solaris, AIX, and later Linux.

2. Linux
 Origins (1991):
Linux was created by Linus Torvalds, a Finnish student, as a free alternative to Unix-based
operating systems. He initially developed the Linux kernel as a personal project on a MINIX
system.

 Timeline:

 1991: Linus Torvalds announced the first Linux kernel (v0.01) on Usenet, stating, “Just a
hobby, won’t be big.” It was released under the GNU General Public License (GPL).

 1992-1994: The kernel was integrated with GNU tools, forming the complete GNU/Linux
system.

 1996: The iconic Tux penguin became Linux's mascot.

 Philosophy:

 Free and open-source software.


 Collaborative development by a global community of contributors.

Legacy and Impact


 Unix: The design principles of Unix (simplicity, modularity, reusability) influenced modern OS
development.

 Linux: Today, Linux powers:

 Servers: 96% of the top 1 million websites.

 Mobile Devices: Android, based on the Linux kernel.

 Supercomputers: Over 90% of the world’s fastest supercomputers.

 IoT Devices and embedded systems.

Overview of the Linux Operating System


Linux is a free, open-source, and widely-used operating system based on the Unix design principles. It is
known for its robustness, flexibility, and scalability, making it suitable for various devices and applications
—from smartphones to supercomputers.

Key Features of Linux


1. Open-Source:
The Linux source code is freely available, and anyone can modify or distribute it under the GNU
General Public License (GPL).

2. Multiuser and Multitasking:


Linux allows multiple users to operate simultaneously and supports running multiple programs
(processes) concurrently.

3. Portability:
Linux can run on a wide range of hardware platforms, from embedded systems to mainframes.

4. Security:

 Offers robust file permissions and user management.

 Includes built-in firewalls (e.g., iptables) and tools for secure networking.

5. Stability and Reliability:


Linux systems can run for years without crashing or requiring a reboot.

6. Customization:
Users can choose from various desktop environments (e.g., GNOME, KDE) and window
managers, or even build their own version.
Components of Linux
1. Kernel:
The core part of Linux that manages hardware resources and facilitates communication between
software and hardware.

 Types: Monolithic kernel, supporting features like process management, file systems,
and device drivers.

2. System Libraries:
These provide essential functions and services (e.g., glibc for C programs).

3. System Utilities:
Tools for managing the system, such as the cp, ls, and rm commands.

4. Shell:
The command-line interface (e.g., Bash, Zsh) for interacting with the OS.

5. File System:
Linux supports various file systems, including ext4, XFS, and Btrfs, providing hierarchical
organization.

6. Desktop Environments (optional):


For graphical user interaction, environments like GNOME, KDE, or XFCE can be installed.

Linux Distributions
Linux comes in various flavors, known as distributions (distros), each tailored for specific needs:

 General Use: Ubuntu, Fedora, Debian.

 Enterprise Servers: CentOS, Red Hat Enterprise Linux (RHEL), SUSE.

 Lightweight Systems: Puppy Linux, Lubuntu.

 Security: Kali Linux, Parrot OS.

Advantages of Linux
 Cost-Effective: Free to use and distribute.

 High Performance: Efficient resource utilization, ideal for servers and heavy computing.

 Scalability: Works on small embedded devices to massive server farms.


 Community Support: A large global community provides support and updates.

Applications of Linux
1. Servers: Linux dominates the server market due to its stability and security.

2. Development: Preferred for programming, with support for multiple languages and tools.

3. Desktop Use: Offers user-friendly distros for personal use.

4. Embedded Systems: Powers IoT devices, routers, and home appliances.

5. Mobile: Android, the most popular mobile OS, is based on the Linux kernel.

6. Supercomputing: Over 90% of supercomputers run Linux.

Why Use Linux?


Linux is favored for its:

 Customization.

 Open-source nature.

 High security and performance.

 Wide hardware compatibility.

Structure of the Linux Operating System


The Linux operating system follows a modular design, with layers working together to provide
functionality. This structure is based on the Unix design principles of simplicity and modularity. Here's a
detailed breakdown:

1. Layers of the Linux Operating System


a. Hardware Layer
 Role:
This layer includes all physical components, such as the CPU, memory, storage devices, and
network interfaces.
 Interaction:
The hardware communicates with the operating system through device drivers in the kernel.

b. Kernel Layer
 The Core Component:
The kernel is the central part of the Linux OS, responsible for managing system resources and
hardware communication.

 Main Functions:

1. Process Management: Schedules and manages processes.

2. Memory Management: Allocates and monitors memory usage.

3. Device Drivers: Interfaces with hardware devices.

4. File System Management: Manages file operations and directories.

5. Networking: Handles communication between systems via protocols.

 Type:
Linux uses a monolithic kernel, meaning most system functions (e.g., drivers, file systems,
networking) run in kernel space for efficiency.

c. Shell Layer
 Role:
The shell acts as a bridge between the user and the kernel. It interprets commands and passes
them to the kernel for execution.

 Types of Shells:

 Bash (Bourne Again Shell): Default shell for most Linux distributions.

 Other Shells: Zsh, Ksh, Fish, and Tcsh.

 Modes of Interaction:

 Command-Line Interface (CLI): Traditional way to interact via commands.

 Graphical User Interface (GUI): Modern Linux distributions also support graphical tools
for ease of use.

d. System Libraries
 Role:
Libraries contain reusable code that applications and the kernel use to perform standard
functions (e.g., file handling, I/O operations).

 Example:
The GNU C Library (glibc) is essential for C programming and system calls.

e. User Applications
 Role:
Applications and utilities are programs users interact with to perform specific tasks (e.g., text
editors, browsers, compilers).

 Examples:

 Text Editors: Vim, Nano, Gedit.

 Browsers: Firefox, Chromium.

2. Linux File System Hierarchy


The Linux OS follows a standardized file structure known as the Filesystem Hierarchy Standard (FHS):

 / (Root): The base of the file system. All directories are subdirectories of /.

 /bin: Essential user commands (e.g., ls, cat).

 /sbin: System administration commands (e.g., reboot).

 /home: User directories (e.g., /home/user).

 /etc: Configuration files.

 /var: Variable files like logs.

 /lib: Libraries needed for binaries in /bin and /sbin.

 /tmp: Temporary files.

 /usr: User-installed programs and utilities.

3. Graphical User Interface (GUI) Layer


 Role:
Provides a graphical environment for users to interact with the system.

 Components:

 Display Server: Handles graphics rendering (e.g., X11, Wayland).

 Window Manager: Manages the layout and appearance of windows.


 Desktop Environment: Combines GUI components, such as GNOME, KDE, or
XFCE.

Simplified Diagram
User Applications

System Shell

System Libraries

Kernel

Hardware

Key Features of the Structure


Modularity: Each layer performs a specific function and interacts with adjacent layers.

Customizability: Users can swap shells, GUIs, and even kernel modules.

Security: Separation between user space (applications) and kernel space (core OS) ensures stability and
security.

How to Install Linux


1. Choose a Distribution:
Pick a Linux distro (e.g., Ubuntu, Fedora, Linux Mint).

2. Download ISO File:


Get the official ISO image from the distribution’s website.

3. Create Bootable Media:


Use tools like Rufus (Windows) or Etcher to create a bootable USB/DVD.

4. Boot from USB/DVD:


Restart your computer, access the boot menu (F12, ESC, or similar), and select the USB/DVD.

5. Run Installer:

 Choose "Try" or "Install Linux."

 Select installation type (Erase disk, Dual boot, or Custom).

 Set partitions if needed (e.g., /, swap, /home).

6. Configure Settings:
 Choose language, keyboard layout, time zone, and create a user account.

7. Complete Installation:
Wait for files to copy, then reboot.

8. Post-Installation:

 Update system: sudo apt update && sudo apt upgrade.

 Install additional software and drivers if needed.

That’s it! You now have Linux installed.

Linux Desktops: The X Window System, GNOME, KDE,


and Desktop Operations
1. The X Window System (X11)
 Definition:
The X Window System (commonly called X or X11) is the foundation for graphical user interfaces
(GUIs) in Linux.

 Role:
Provides basic graphical functionalities like displaying windows, handling user input, and
managing screens. It does not dictate how the desktop looks; instead, it serves as the underlying
protocol for GUI applications.

 Features:

 Network transparency: Applications can run on one machine and display on another.

 Modular architecture: Allows the use of different window managers or desktop


environments.

2. GNOME (GNU Network Object Model Environment)


 Overview:
GNOME is a popular desktop environment that emphasizes simplicity, ease of use, and
productivity.

 Features:

 A clean and modern interface with activities overview for managing applications.

 Built-in applications like Files (file manager), GNOME Terminal, and Settings.
 Customization via GNOME extensions.

 Usage:
Default in distributions like Ubuntu, Fedora, and Debian.

 Ideal For:
Users seeking a simple and elegant desktop experience.

3. KDE (K Desktop Environment)


 Overview:
KDE is a feature-rich, highly customizable desktop environment designed for advanced users and
productivity.

 Features:

 Applications: Includes tools like Dolphin (file manager), Konsole (terminal), and Okular
(PDF viewer).

 Widgets: Desktop and panel widgets for added functionality.

 Customization: Nearly every element can be tweaked, from themes to workflows.

 Usage:
Default in distributions like KDE Neon, Kubuntu, and openSUSE.

 Ideal For:
Users who prefer a Windows-like interface with advanced customization options.

Desktop Operations
Desktop operations refer to basic tasks you perform within a desktop environment. Here are common
operations:

a. Working with Windows

 Open, Close, Minimize, Maximize

b. File Management

 Use file managers like:

 Nautilus (GNOME

 Dolphin (KDE)

c. Application Management

 Launch Applications
 Switch Between Applications

d. System Customization

 Change Wallpaper

 Themes and Appearance

 Panel/Dock Customization

e. System Settings

 Manage network connections, power settings, user accounts, and updates from the system
settings interface.

Editors in Linux
Linux provides various text editors to create, view, and modify files. These editors can be categorized into
two types:

1. Types of Editors
a. Command-Line Editors
 Operate in a terminal environment.

 Ideal for server environments or quick file edits.

b. Graphical Editors
 Require a graphical environment (GUI).

 User-friendly and feature-rich for complex tasks.

2. The vi Editor
The vi editor (and its improved version, vim) is a popular command-line editor in Linux. It is fast,
lightweight, and comes pre-installed in most Linux distributions.

Modes in vi:
 Command Mode (default)

 Insert Mode

 Ex Mode
3. Basic Commands in vi
a. Starting vi:
 Open a file:

vi filename

 Open a file in read-only mode:

vi -R filename

b. Navigation Commands:
 h: Move left.

 l: Move right.

 j: Move down.

 k: Move up.

 Ctrl+d: Scroll down half a page.

 Ctrl+u: Scroll up half a page.

 G: Move to the end of the file.

 gg: Move to the beginning of the file.

c. Insert Mode Commands:


 i: Insert at the current position.

 a: Append after the current character.

 o: Open a new line below the current one.

d. Saving and Exiting:


 :w: Save changes.

 :q: Quit (if no changes made).

 :wq or :x: Save and quit.

 :q!: Quit without saving.

e. Editing Commands:
 x: Delete the current character.

 dd: Delete the current line.

 yy: Copy the current line.


 p: Paste copied/deleted content after the cursor.

 u: Undo the last change.

 Ctrl+r: Redo the last undone change.

f. Search Commands:
 /pattern: Search forward for "pattern."

 ?pattern: Search backward for "pattern."

 n: Repeat the last search in the same direction.

 N: Repeat the last search in the opposite direction.

g. Replace Commands:
 Replace a word under the cursor:

:s/old/new

 Replace all occurrences in the file:

:%s/old/new/g

h. Split Window (Vim-only):


 Open a horizontal split:

:split filename

 Open a vertical split:

:vsplit filename

4. Advantages of vi/vim
 Lightweight and available on all Unix/Linux systems.

 Fast and efficient for editing large files.

 Extensible and customizable (in vim).

Would you like an example or further explanation of

You might also like