0% found this document useful (0 votes)
12 views17 pages

Module 1

Uploaded by

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

Module 1

Uploaded by

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

Operating System

 An operating system is a set of basic system programs that


manage computer hardware to perform basic computer
functions, that is, it enables a connection between hardware
and user programs.
 It is a type of software that interface between user and
computer hardware devices.
 It performs all the basic tasks like file management,
memory management, process management, handling input
and output, and controlling peripheral devices such as disk
drives and printers.

 Some popular Operating Systems include Linux, Windows
, macOS, iOS, Android, etc.

Linux
 Linux is a free, open-source operating system kernel that
serves as the foundation for a variety of operating systems
known as Linux distributions.
 It was originally developed by Linus Torvalds in 1991 and
has since become one of the most widely used operating
systems, especially in servers, embedded systems, and
increasingly in desktop environments.
 It is freely available for commercial as well as for non-
commercial purposes. As it is available for commercial
purposes that means any programmer can do some changes
in the Linux kernel by doing some code and finally make it
as the new distribution.
 Distributions (Distros):
 Linux distributions bundle the Linux kernel with a package
management system, software, and utilities.

Popular Linux distros include:

 Ubuntu: A user-friendly distribution based on Debian,


popular for desktop use.
 Debian: A stable, non-commercial distribution focused on
free software.
 Fedora: Sponsored by Red Hat, known for using the latest
software versions.
 CentOS: A free alternative to Red Hat Enterprise Linux
(RHEL).
 Arch Linux: Known for its simplicity and customizability.
 Mint: Based on Ubuntu, offers a polished, user-friendly
experience.
 Linux Architecture

 The Linux operating system’s architecture contains some of


the components: the Kernel, System Library, Hardware
layer, System, and Shell utility.
1. Kernel:

 The core of the Linux operating system, responsible for


managing hardware resources like CPU, memory, and I/O
devices.
 It provides a bridge between applications and the actual
hardware.
 The Linux kernel is monolithic, meaning all the core
functionality is part of one large block of code, but it can
dynamically load modules.

 Monolithic Kernel- A monolithic kernel is a type of


kernel where the entire operating system runs in
kernel space (privileged mode). All the core services,
such as process management, memory management,
file systems, and device drivers, run in a single
address space (the kernel space).

 Micro kernels- Microkernels aim to minimize the


kernel's size by only including the most essential
services in kernel space. These essential services
usually include process management, memory
management, and inter-process communication (IPC).
Other services, such as device drivers, file systems,
and network stacks, run in user space.

 Exo kernels- An exokernel is a minimalistic kernel


architecture that aims to provide direct access to the
hardware without imposing abstractions typically
seen in traditional operating systems. Instead of
providing high-level abstractions (such as file systems
or network protocols), exokernels expose raw
hardware resources directly to applications, allowing
them to define their own abstractions.

 Hybrid kernels- A hybrid kernel attempts to combine


the benefits of both monolithic and microkernel
architectures.

 2. System Libraries:- System libraries are collections of


reusable code that programs and applications in an
operating system can use to perform common tasks. In the
context of Linux and Unix-like systems, system libraries
provide essential functionality such as interacting with the
operating system kernel, handling input/output, performing
mathematical operations, managing files, and more.

 3. System and shell Utility :- System utilities in Linux are


tools and programs that allow users and administrators to
interact with the operating system, manage resources,
monitor performance, and perform various administrative
tasks. These utilities are essential for maintaining and
configuring the system, managing files, monitoring
processes, and ensuring system security and performance.
1. File and Directory Management Utilities:

These utilities help users manage files, directories, and


permissions.
 ls: Lists files and directories.
 cp: Copies files and directories.
 mv: Moves or renames files and directories.
 rm: Removes files and directories.
 mkdir: Creates a new directory.
 rmdir: Removes empty directories.
 chmod: Changes file permissions.
 chown: Changes the ownership of files or directories.
 find: Searches for files and directories based on various
criteria.
 df: Displays disk space usage.
 du: Shows the size of files and directories.
2. Process Management Utilities:

These utilities help manage system processes, including


monitoring, starting, and stopping processes.
 ps: Displays information about active processes.
 top / htop: Displays real-time information about system
processes and resource usage.
 kill: Sends signals to processes, often used to terminate
processes.
 killall: Kills processes by name.
 bg / fg: Moves jobs to the background (bg) or foreground
(fg).
 nice / renice: Sets or changes the priority of a process.
 systemctl: Controls system services and daemons (used
with systemd).
3. Disk and Filesystem Utilities:

Utilities that help manage and maintain disks, partitions, and


filesystems.
 fdisk: Command-line utility for partitioning hard drives.
 mkfs: Creates a new filesystem on a partition (e.g.,
mkfs.ext4).
 fsck: Checks and repairs filesystem inconsistencies.
 mount: Mounts a filesystem or device.
 umount: Unmounts a filesystem or device.
 blkid: Displays block device attributes, such as UUIDs.
 tune2fs: Tunes or modifies the settings of an ext2/ext3/ext4
filesystem.
 parted: A disk partitioning tool.
4. User Management Utilities:

These utilities help manage users, groups, and permissions.


 useradd: Adds a new user to the system.
 usermod: Modifies an existing user’s account.
 userdel: Deletes a user account.
 passwd: Changes a user’s password.
 groupadd: Adds a new group.
 groupdel: Deletes a group.
 id: Displays user ID and group information.
 whoami: Displays the current username.
5. System Monitoring Utilities:

These tools provide insights into system performance, including


CPU, memory, network usage, and overall system health.
 uptime: Shows how long the system has been running and
system load averages.
 free: Displays information about memory usage.
 vmstat: Displays virtual memory statistics and
performance metrics.
 iostat: Reports CPU and I/O statistics.
 sar: Collects and reports system activity and performance
statistics.
 netstat: Displays network connections, routing tables, and
interface statistics.
 dstat: Provides comprehensive system resource statistics.
 iostat: Reports CPU and input/output statistics for devices.
 mpstat: Reports individual CPU core statistics.
6. Networking Utilities:

These utilities help configure and monitor the network, test


connectivity, and troubleshoot network-related issues.
 ifconfig: Configures network interfaces (deprecated in
favor of ip command).
 ip: A more modern tool to configure network interfaces,
routing, and more.
 ping: Tests network connectivity between systems.
 traceroute: Traces the route packets take to a network
destination.
 netstat: Displays active network connections and listening
ports.
 ss: Displays socket statistics, a more modern alternative to
netstat.
 dig: DNS lookup tool to query DNS records.
 nslookup: Another DNS lookup tool.
 tcpdump: Captures and analyzes network packets.
 iptables / nftables: Configures the firewall rules to control
network traffic.
7. System Boot and Service Management:

Tools that help manage system startup processes, services, and


daemons.
 systemctl: Manages systemd services, used to start, stop,
and manage system services.
 service: Manages services on older systems that don't use
systemd.
 journalctl: Views logs generated by systemd and its
services.
 cron: A daemon used to schedule recurring tasks.
 at: Schedules one-time tasks to be run at a specified time.
 init: Manages the system initialization process (replaced by
systemd in many Linux distros).
 grub: Bootloader used to manage multi-boot systems and
configure the kernel.
8. Package Management Utilities:

Package management tools help install, update, remove, and


manage software packages on the system.
 apt-get / apt: Command-line package management tool for
Debian-based distributions (e.g., Ubuntu).
 yum / dnf: Command-line package management tools for
Red Hat-based distributions (e.g., CentOS, Fedora).
 rpm: A package manager for Red Hat-based systems.
 pacman: The package manager for Arch Linux and its
derivatives.
 snap: A package management system for Linux that
enables installation of software packages in a universal
format.
 flatpak: Another system for managing universal Linux
software packages.
9. Backup and Compression Utilities:

Utilities for archiving, compressing, and backing up files and


directories.
 tar: Combines multiple files into one archive file (often
with compression).
 gzip / gunzip: Compresses and decompresses files using
the gzip format.
 bzip2 / bunzip2: Compresses and decompresses files using
the bzip2 format.
 zip / unzip: Compresses and decompresses files in the zip
format.
 rsync: Synchronizes files and directories between two
locations.
 dd: Used for low-level copying and backup of disks and
partitions.
10. Text Processing Utilities:

These utilities help process and manipulate text files, often used
in shell scripting and automation.
 cat: Concatenates and displays file contents.
 grep: Searches for patterns within text.
 awk: A powerful pattern scanning and processing
language.
 sed: A stream editor for editing text in-place.
 cut: Extracts sections of each line in a file.
 sort: Sorts lines in text files.
 wc: Word count utility that counts lines, words, and
characters in files.
 head / tail: Outputs the first/last parts of files.
11. System Information Utilities:

These utilities provide information about the system’s hardware,


software, and configuration.
 uname: Displays system information such as kernel name
and version.
 hostnamectl: Displays and sets the hostname of the
system.
 lshw: Lists detailed information about the hardware
configuration.
 lsblk: Lists information about all available block devices.
 lscpu: Displays information about the CPU architecture.
 dmidecode: Extracts hardware information from the
system BIOS.
 lsusb: Lists USB devices.
 lspci: Lists PCI devices.
 dmesg: Displays system messages, especially useful for
debugging hardware issues.

4. Hardware layer:- This operating system contains a hardware


layer that consists of several peripheral devices like CPU, HDD,
and RAM.
Shell:-
The primary function of the shell is to execute user commands.

 Commands like file operations (ls, cp, mv), process


management (ps, kill), and system information (df, free) are
handled by the shell.

 It is an interface among the kernel and user.

 The shell interprets user input, translates it into instructions


for the system, and provides the output or performs the
desired task.

 It can take commands through the user and runs the


functions of the kernel. The shell is available in distinct
types of operating system’s. These operating systems are
categorized into two different types of shells, which are
the graphical shells and command-line shells.

 The graphical line shells facilitate the graphical user


interface, while the command line shells facilitate the
command line interface. Thus, both of these shells
implement operations. However, the graphical user
interface shells work slower as compared to the command-
line interface shells.
Common Linux shells include:
 Bash (Bourne Again Shell) is the default in many distros.
 Zsh, Fish, Ksh, and others are also available for advanced
users.

Benefits of Linux

 It offers a free operating system on the internet.

 It is easy to learn Linux for beginners

 Being open-source, anyone with programming knowledge


can modify it.

 Multitasking operating system: can run multiple job


simultaneously without affecting the system speed

 Capable of handling large no. of users simultaneously

 security : It’s not completely safe but less vulnerable than


others, does not required any antivirus program

 Once you have Linux installed you no longer need an


antivirus! Linux is a highly secure system. Virus is not
executed until the administrator send the Password

 Light weight-less requirement for running Linux

 Linux freeware is the OS of choice for Server environments


due to its stability and reliability (Mega-companies like
Amazon, Facebook, and Google use Linux for their
Servers)..

 Provide high performance over a different networks

 Flexible, can be used for desktop/server app ,embedded


system

 Software updates are in user control: more faster updates,


system update continuously without failing any issues

 programmers can design their own custom operating system

Why the Linux is better than other OS?


 There are many features of Linux that demonstrate that it is
better than other operating system

 Free to Use:- Linux is accessible to the public for free.


However, that is not the case with Windows.

 Variety Of Distributions:- You will find tons of Linux


distributions catered for a different set of needs.
Customization :- Apart from installing themes , you have
tons of beautiful icon themes. You can also do a lot around
wallpapers in Linux.

 Software update
 Open Source Nature :-

 Secure :- Linux does not require the use of such Anti-


Virus programs. Being secure by nature would make things
easier for you and save money as well because you will not
have to get a premium Antivirus software.

 Reliability :-

 perfect for programmers :- Linux supports almost all of the


major programming languages (Python, C/C++, Java, Perl,
Ruby, etc.).

Disadvantages:
 One of the main disadvantages of Linux is that it can have a
steeper learning curve compared to other operating systems

 Software compatibility: One more potential disadvantage


of Linux is that some of the software and applications may
not be readily available.

 Hardware Compatibility: In Linux, certain hardware


devices have limited or no support at all. This can be due to
several reasons, such as the device not having an open-
source driver or the manufacturer not providing Linux-
compatible drivers.
 Lack of Standardization: Another point that falls under
the disadvantages of Linux is the lack of standardization in
the ecosystem.

Lab work
o Linux Directory Commands
o Linux File Commands
o Linux File Content Commands

You might also like